This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
malloc.c: Use isDIGIT macro instead of hand-rolling it
authorKarl Williamson <khw@cpan.org>
Sat, 7 Sep 2019 15:18:49 +0000 (09:18 -0600)
committerKarl Williamson <khw@cpan.org>
Tue, 12 Nov 2019 04:05:13 +0000 (21:05 -0700)
The macro is more efficient

malloc.c

index ded9868..66db775 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -1688,7 +1688,7 @@ morecore(int bucket)
                    IV val = 0;
 
                    t += 2;
-                   while (*t <= '9' && *t >= '0')
+                   while (isDIGIT(*t))
                        val = 10*val + *t++ - '0';
                    if (!*t || *t == ';') {
                        if (MallocCfg[off - opts] != val)