[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;
- [PATCH 0/5] Miscellaneous speed up patches, Paolo Bonzini, 2016/11/02
- [PATCH 1/5] optimize checking for globs, Paolo Bonzini, 2016/11/02
- Re: [PATCH 1/5] optimize checking for globs,
Paolo Bonzini <=
- [PATCH 3/5] use jhash for STRING_N_HASH, Paolo Bonzini, 2016/11/02
- [PATCH 5/5] speedup parsing of functions, Paolo Bonzini, 2016/11/02
- [PATCH 4/5] remove MAP_PERCENT, Paolo Bonzini, 2016/11/02
- [PATCH 2/5] use strchr for simple case of find_char_unquote, Paolo Bonzini, 2016/11/02
- Re: [PATCH 0/5] Miscellaneous speed up patches, Paolo Bonzini, 2016/11/11