Skip to content

Commit b89e80f

Browse files
committed
grok_bin_oct_hex: Move declaration of variable to first need
This caused an extra assignment that was then discarded
1 parent d4b3580 commit b89e80f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

numeric.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ Perl_grok_bin_oct_hex(pTHX_ const char *start,
402402
const bool allow_underscores =
403403
cBOOL(input_flags & PERL_SCAN_ALLOW_UNDERSCORES);
404404
const char * s = start;
405-
const char * s0 = s; /* Where the significant digits start */
406405
const char * e = start + *len_p;
407406

408407
if (!(input_flags & PERL_SCAN_DISALLOW_PREFIX)) {
@@ -411,19 +410,19 @@ Perl_grok_bin_oct_hex(pTHX_ const char *start,
411410
for compatibility silently suffer "b" and "0b" as valid binary; "x"
412411
and "0x" as valid hex numbers. */
413412
if (e - s > 1) {
414-
if (isALPHA_FOLD_EQ(s0[0], prefix)) {
415-
s0++;
413+
if (isALPHA_FOLD_EQ(s[0], prefix)) {
414+
s++;
416415
}
417416
else if ( e - s > 2
418-
&& s0[0] == '0'
419-
&& (isALPHA_FOLD_EQ(s0[1], prefix)))
417+
&& s[0] == '0'
418+
&& (isALPHA_FOLD_EQ(s[1], prefix)))
420419
{
421-
s0+=2;
420+
s += 2;
422421
}
423422
}
424423
}
425424

426-
s = s0; /* s0 potentially advanced from 'start' */
425+
const char * const s0 = s; /* Where the significant digits start */
427426
UV value = 0;
428427

429428
/* Unroll the loop so that the first 8 digits are branchless except for the

0 commit comments

Comments
 (0)