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

2014-03-03 Thread Junio C Hamano
Siddharth Goel siddharth98...@gmail.com writes: Helped-by: Eric Sunshine sunsh...@sunshineco.com Signed-off-by: Siddharth Goel siddharth98...@gmail.com --- Added a space after colon in the subject as compared to previous patch [PATCH v2]. [PATCH v2]:

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

2014-03-03 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Siddharth Goel siddharth98...@gmail.com writes: Helped-by: Eric Sunshine sunsh...@sunshineco.com Signed-off-by: Siddharth Goel siddharth98...@gmail.com --- Added a space after colon in the subject as compared to previous patch [PATCH v2]. [PATCH

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

2014-03-03 Thread David Kastrup
Junio C Hamano gits...@pobox.com 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); -

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

2014-03-03 Thread Junio C Hamano
David Kastrup d...@gnu.org 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

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 gits...@pobox.com 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

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

2014-03-03 Thread David Kastrup
Duy Nguyen pclo...@gmail.com writes: On Tue, Mar 4, 2014 at 5:43 AM, Junio C Hamano gits...@pobox.com 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

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 pclo...@gmail.com writes: On Tue, Mar 4, 2014 at 5:43 AM, Junio C Hamano gits...@pobox.com wrote: diff --git a/git-compat-util.h b/git-compat-util.h index cbd86c3..68ffaef 100644 --- a/git-compat-util.h +++