summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numeric.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/numeric.c b/numeric.c
index d9e7b3581c..fe5e0f723b 100644
--- a/numeric.c
+++ b/numeric.c
@@ -335,10 +335,12 @@ Perl_grok_bin_oct_hex(pTHX_ const char *start,
if (_generic_isCC(*s, class_bit)) {
/* Write it in this wonky order with a goto to attempt to get the
compiler to make the common case integer-only loop pretty tight.
- With gcc seems to be much straighter code than old scan_hex. */
+ With gcc seems to be much straighter code than old scan_hex.
+ (khw suspects that adding a LIKELY() just above would do the
+ same thing) */
redo:
if (!overflowed) {
- if (value <= max_div) {
+ if (LIKELY(value <= max_div)) {
value = (value << shift) | XDIGIT_VALUE(*s);
/* Note XDIGIT_VALUE() is branchless, works on binary
* and octal as well, so can be used here, without