bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/5] optimize checking for globs


From: Paolo Bonzini
Subject: Re: [PATCH 1/5] optimize checking for globs
Date: Fri, 11 Nov 2016 12:32:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0


On 02/11/2016 17:24, Paolo Bonzini wrote:
> +int needs_glob(const char *s)
> +{
> +  return strpbrk (s, "?*[") == NULL;

My bad, this should be "!=" NULL.  I will send a v2 when I get more
feedback.

Paolo

> +}
> +#endif
> diff --git a/read.c b/read.c
> index b870aa8..0883100 100644
> --- a/read.c
> +++ b/read.c
> @@ -3268,7 +3268,7 @@ parse_file_seq (char **stringp, unsigned int size, int 
> stopmap,
>  #endif /* !NO_ARCHIVES */
>  
>        /* glob() is expensive: don't call it unless we need to.  */
> -      if (NONE_SET (flags, PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL)
> +      if (NONE_SET (flags, PARSEFS_EXISTS) && !needs_glob (name))
>          {
>            globme = 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]