diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2016-10-11 13:51:30 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-11 15:06:30 -0700 |
commit | 1204c77f9b6ab8ba8cc6cfe00342f5e64a740cdf (patch) | |
tree | 7c48ad22c756dc7b6215ac5aca362bc192efd35a /lib/kstrtox.c | |
parent | bf90e56e467ed5766722972d483e6711889ed1b0 (diff) | |
download | lwn-1204c77f9b6ab8ba8cc6cfe00342f5e64a740cdf.tar.gz lwn-1204c77f9b6ab8ba8cc6cfe00342f5e64a740cdf.zip |
include/linux/ctype.h: make isdigit() table lookupless
Make isdigit into a simple range checking inline function:
return '0' <= c && c <= '9';
This code is 1 branch, not 2 because any reasonable compiler can
optimize this code into SUB+CMP, so the code
while (isdigit((c = *s++)))
...
remains 1 branch per iteration HOWEVER it suddenly doesn't do table
lookup priming cacheline nobody cares about.
Link: http://lkml.kernel.org/r/20160826190047.GA12536@p183.telecom.by
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/kstrtox.c')
0 files changed, 0 insertions, 0 deletions