diff options
author | Karl Williamson <khw@cpan.org> | 2020-01-06 17:32:35 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-01-13 20:58:56 -0700 |
commit | bcfb98ec0765d242dbd6338c36fb54cd40f6a9d9 (patch) | |
tree | cce60921b8e5f81b4ad5c3accf423a2f6ad75ba9 /perl.h | |
parent | 2ae9030c44be214caa0d1eeafad9425a53344feb (diff) | |
download | perl-bcfb98ec0765d242dbd6338c36fb54cd40f6a9d9.tar.gz |
Collapse grok_bin, _oct, _hex into one function
These functions are identical in logic in the main loop, the difference
being which digits they accept. The rest of the code had slight
variations. This commit unifies the functions.
I presume the reason they were kept separate was because of speed.
Future commits will make this unified function faster than blead, and
the reduced maintenance cost makes this worthwhile.
Diffstat (limited to 'perl.h')
-rw-r--r-- | perl.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -6890,6 +6890,10 @@ C<strtoul>. # define Atoul(s) Strtoul(s, NULL, 10) #endif +#define grok_bin(s,lp,f,r) grok_bin_oct_hex(s, lp, f, r, 1) +#define grok_oct(s,lp,f,r) grok_bin_oct_hex(s, lp, f, r, 3) +#define grok_hex(s,lp,f,r) grok_bin_oct_hex(s, lp, f, r, 4) + #ifndef PERL_SCRIPT_MODE #define PERL_SCRIPT_MODE "r" #endif |