Skip to content

Commit c202865

Browse files
committed
grok_bin_oct_hex: Avoid two recalculations
We already have this value in a variable.
1 parent 49ddb48 commit c202865

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

numeric.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ Perl_grok_bin_oct_hex(pTHX_ const char *start,
513513
/* Note XDIGIT_VALUE() is branchless, works on binary
514514
* and octal as well, so can be used here, without
515515
* slowing those down */
516-
factor *= 1 << shift;
516+
factor *= base;
517517
continue;
518518
}
519519

@@ -530,7 +530,7 @@ Perl_grok_bin_oct_hex(pTHX_ const char *start,
530530
* 'value_nv' eventually, either when all digits are gone, or we
531531
* have overflowed this fresh start. */
532532
value = XDIGIT_VALUE(*s);
533-
factor = 1 << shift;
533+
factor = base;
534534

535535
if (! overflowed) {
536536
overflowed = TRUE;

0 commit comments

Comments
 (0)