Re: [PATCH/RFC 1/n] gitweb: Better git-unquoting and gitweb-quoting of pathnames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dnia piątek 3. listopada 2006 12:58, Junio C Hamano napisał:
> Jakub Narebski <jnareb@xxxxxxxxx> writes:
> 
>> Perhaps it should be "LF ('\n') and TAB ('\t')".
> 
> Official terminology seems to call \t "HT", but my feeling is
> that we would not need that comment there.

O.K. I'll remove that comment.

>> Or
>> 	return $es{$seq} if exists $es{$seq};
> 
> Although gitweb is full of that syntax, I personally do not like
> it very much.  It is really hard to read when you are trying to
> skim through the code quickly.  You would have to say "why
> return it?  ah -- only when it exists, then it makes sense",
> which is a hiccup that disrupts the thought process.

O.K., I'll change style from

	return chr(oct($seq))  if ($seq =~ m/^[0-7]{1,3}$/);
	return $es{$seq}       if exists $es{$seq};
	return $seq;

to the more readable form

	if ($seq =~ m/^[0-7]{1,3}$/) {
		return chr(oct($seq));
	} elsif (exists $es{$seq}) {
		return $es{$seq};
	}
	return $seq;

I think it is better to leave final "return $seq;" outside else block.
-- 
Jakub Narebski
Poland
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]