Re: [PATCH 2/3] exclude: do strcmp as much as possible before fnmatch
- From
Thiago Farina <tfransosi@gmail.com>
- Date
- May 29, 2012, 18:21 UTC
- Message-ID
- <CACnwZYeB2Da5mEtw9xX9pPnCa=Ld4WoePsJytn90L9XwO2+WxQ@mail.gmail.com>
- In-Reply-To
- <7v8vga6f1a.fsf@alter.siamese.dyndns.org>
On Tue, May 29, 2012 at 3:03 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 21 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
>
>> this also avoids calling fnmatch() if the non-wildcard prefix is
>> longer than basename
>>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>> dir.c | 41 +++++++++++++++++++++++++++--------------
>> dir.h | 2 +-
>> 2 files changed, 28 insertions(+), 15 deletions(-)
>>
>> diff --git a/dir.c b/dir.c
>> index 8535cf2..50d744f 100644
>> --- a/dir.c
>> +++ b/dir.c
>> @@ -295,9 +295,11 @@ int match_pathspec_depth(const struct pathspec *ps,
>> return retval;
>> }
>>
>> +const char *wildcards = "*?[{\\";
>nit: can this be const char wildcards[] = "..."; ?
also an unrelated question, is there a style guide for naming constants like this? In chromium project we write them like kFoo.