Re: [PATCH/RFC 1/n] gitweb: Better git-unquoting and gitweb-quoting of pathnames
Dnia piątek 3. listopada 2006 12:58, Junio C Hamano napisał:
Show 6 quoted lines
> Jakub Narebski <jnareb@gmail.com> 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.
Show 8 quoted lines
>> 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