summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-01-06 17:32:35 -0700
committerKarl Williamson <khw@cpan.org>2020-01-13 20:58:56 -0700
commitbcfb98ec0765d242dbd6338c36fb54cd40f6a9d9 (patch)
treecce60921b8e5f81b4ad5c3accf423a2f6ad75ba9 /perl.h
parent2ae9030c44be214caa0d1eeafad9425a53344feb (diff)
downloadperl-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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl.h b/perl.h
index 8e77d0ca5b..969dfc92f4 100644
--- a/perl.h
+++ b/perl.h
@@ -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