[PATCH 2/5] sha1_name.c: don't waste cycles in the @-parsing loop

2013-05-01 Thread Ramkumar Ramachandra
The @-parsing loop unnecessarily checks for the sequence "@{" from len - 2 unnecessarily. We can safely check from len - 4: write out a comment justifying this. Signed-off-by: Ramkumar Ramachandra --- sha1_name.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --g

Re: [PATCH 2/5] sha1_name.c: don't waste cycles in the @-parsing loop

2013-05-01 Thread Felipe Contreras
On Wed, May 1, 2013 at 11:20 AM, Ramkumar Ramachandra wrote: > The @-parsing loop unnecessarily checks for the sequence "@{" from > len - 2 unnecessarily. We can safely check from len - 4: write out a > comment justifying this. > > Signed-off-by: Ramkumar Ramachandra > --- > sha1_name.c | 18 ++

Re: [PATCH 2/5] sha1_name.c: don't waste cycles in the @-parsing loop

2013-05-01 Thread Ramkumar Ramachandra
Felipe Contreras wrote: > I think this comment is overkill. That's not for one line. It's for the whole logic following it: there are things like (len-1) - (at+2) which are easy to visualize with this picture. They're int, not char *. -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH 2/5] sha1_name.c: don't waste cycles in the @-parsing loop

2013-05-01 Thread Junio C Hamano
Felipe Contreras writes: > On Wed, May 1, 2013 at 11:20 AM, Ramkumar Ramachandra > wrote: >> The @-parsing loop unnecessarily checks for the sequence "@{" from >> len - 2 unnecessarily. We can safely check from len - 4: write out a >> comment justifying this. >> >> Signed-off-by: Ramkumar Ramac