This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][RFC] Avoid table lookup in isascii, isxdigit.
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Rich Felker <dalias at aerifal dot cx>
- Cc: OndÅej BÃlka <neleai at seznam dot cz>, libc-alpha at sourceware dot org
- Date: Sat, 13 Apr 2013 08:52:43 -0700
- Subject: Re: [PATCH][RFC] Avoid table lookup in isascii, isxdigit.
- References: <20130409115706 dot GA7587 at domone dot kolej dot mff dot cuni dot cz> <20130412204241 dot GK20323 at brightrain dot aerifal dot cx> <51687F17 dot 3070806 at cs dot ucla dot edu> <20130413064316 dot GL20323 at brightrain dot aerifal dot cx>
On 04/12/2013 11:43 PM, Rich Felker wrote:
> Then make it ((unsigned)(int)(c)-'0'<10).
On further thought, that's dubious too.
An implementation is required to diagnose a call
like 'isdigit ("")' but the above implementation
wouldn't necessarily do that.
I think OndÅej's original implementation should work fine.
(As a style issue, I prefer to omit the unnecessary parentheses,
though, and I don't understand why the change added them.)