Re: [PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-04 Thread David Kastrup
Duy Nguyen writes: > On Tue, Mar 04, 2014 at 01:09:39AM +0100, David Kastrup wrote: >> Duy Nguyen writes: >> >> > On Tue, Mar 4, 2014 at 5:43 AM, Junio C Hamano wrote: >> >> diff --git a/git-compat-util.h b/git-compat-util.h >> >> index cbd86c3..68ffaef 100644 >> >> --- a/git-compat-util.h >>

Re: [PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-03 Thread Duy Nguyen
On Tue, Mar 04, 2014 at 01:09:39AM +0100, David Kastrup wrote: > Duy Nguyen writes: > > > On Tue, Mar 4, 2014 at 5:43 AM, Junio C Hamano wrote: > >> diff --git a/git-compat-util.h b/git-compat-util.h > >> index cbd86c3..68ffaef 100644 > >> --- a/git-compat-util.h > >> +++ b/git-compat-util.h > >

Re: [PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-03 Thread David Kastrup
Duy Nguyen writes: > On Tue, Mar 4, 2014 at 5:43 AM, Junio C Hamano wrote: >> diff --git a/git-compat-util.h b/git-compat-util.h >> index cbd86c3..68ffaef 100644 >> --- a/git-compat-util.h >> +++ b/git-compat-util.h >> @@ -357,8 +357,14 @@ extern int suffixcmp(const char *str, const char >> *su

Re: [PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-03 Thread Duy Nguyen
On Tue, Mar 4, 2014 at 5:43 AM, Junio C Hamano wrote: > diff --git a/git-compat-util.h b/git-compat-util.h > index cbd86c3..68ffaef 100644 > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -357,8 +357,14 @@ extern int suffixcmp(const char *str, const char > *suffix); > > static inline con

Re: [PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-03 Thread Junio C Hamano
David Kastrup writes: > How about a function body of > > do { > if (!*prefix) > return str; > } while (*str++ == *prefix++); > return NULL; > > I'm not too fond of while (1) and tend to use for (;;) instead, but that > may again partly be

Re: [PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-03 Thread David Kastrup
Junio C Hamano writes: > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -357,8 +357,14 @@ extern int suffixcmp(const char *str, const char > *suffix); > > static inline const char *skip_prefix(const char *str, const char *prefix) > { > - size_t len = strlen(prefix); > - retur

Re: [PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-03 Thread Junio C Hamano
Junio C Hamano writes: > Siddharth Goel writes: > >> Helped-by: Eric Sunshine >> Signed-off-by: Siddharth Goel >> --- >> Added a space after colon in the subject as compared to previous >> patch [PATCH v2]. >> >> [PATCH v2]: http://thread.gmane.org/gmane.comp.version-control.git/243150 > > Wh

Re: [PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-03 Thread Junio C Hamano
Siddharth Goel writes: > Helped-by: Eric Sunshine > Signed-off-by: Siddharth Goel > --- > Added a space after colon in the subject as compared to previous > patch [PATCH v2]. > > [PATCH v2]: http://thread.gmane.org/gmane.comp.version-control.git/243150 Whenever you see "Change", "Rewrite", et

[PATCH v3] skip_prefix: rewrite so that prefix is scanned once

2014-03-02 Thread Siddharth Goel
Helped-by: Eric Sunshine Signed-off-by: Siddharth Goel --- Added a space after colon in the subject as compared to previous patch [PATCH v2]. [PATCH v2]: http://thread.gmane.org/gmane.comp.version-control.git/243150 git-compat-util.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-