OSDN Git Service

libbb: smaller isdigit. -95 bytes
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 23 Oct 2009 00:22:03 +0000 (02:22 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 23 Oct 2009 00:22:03 +0000 (02:22 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
include/libbb.h

index fb7296f..ad0d59d 100644 (file)
@@ -1579,9 +1579,10 @@ extern const char bb_default_login_shell[];
 #undef isupper
 #undef isxdigit
 
-/* This one is more efficient - we save ~400 bytes */
+/* This one is more efficient - we save ~500 bytes.
+ * BTW, x86 likes (unsigned char) cast more than (unsigned). */
 #undef isdigit
-#define isdigit(a) ((unsigned)((a) - '0') <= 9)
+#define isdigit(a) ((unsigned char)((a) - '0') <= 9)
 
 /* This one is more efficient too! ~200 bytes */
 /* In POSIX/C locale (the only locale we care about: do we REALLY want