This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] Improve wordexp performance.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Ondřej Bílka <neleai at seznam dot cz>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 13 May 2015 15:59:20 +0000
- Subject: Re: [RFC] Improve wordexp performance.
- Authentication-results: sourceware.org; auth=none
- References: <20150513124945 dot GA4067 at domone>
On Wed, 13 May 2015, Ondřej Bílka wrote:
> +static int
> +in_charset (char c, uint32_t *charset)
> +{
> + return charset[c / 32] & (1 << (c % 32));
> +}
> +
> +static void
> +make_charset (char *a, uint32_t *b)
> +{
> + int i;
> + for (i = 0; i < 8; i++)
> + b[i] = 0;
> + while (*a)
> + {
> + b[*a / 32] |= 1 << (*a % 32);
> + a++;
> + }
> +}
Anything like this using possibly signed char seems suspect; I'd expect it
to use unsigned char unless there is a clearly documented reason why
negative values aren't possible.
--
Joseph S. Myers
joseph@codesourcery.com