scan_num: Reorder case: statements in switch()

Move the default to the end, and the shortest to the beginning.  This is
in preparation for future commits.
This commit is contained in:
Karl Williamson 2025-11-03 04:21:12 -07:00 committed by Karl Williamson
parent 2bdcfe0cb2
commit 8c1024baa9

24
toke.c
View File

@ -12500,8 +12500,16 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp)
/* We use the first character to decide what type of number this is */
switch (*s) {
default:
croak("panic: scan_num, *s=%d", *s);
/* if it starts with a v, it could be a v-string */
case 'v':
vstring:
sv = newSV(5); /* preallocate storage space */
ENTER_with_name("scan_vstring");
SAVEFREESV(sv);
s = scan_vstring(s, PL_bufend, sv);
SvREFCNT_inc_simple_void_NN(sv);
LEAVE_with_name("scan_vstring");
break;
/* if it starts with a 0, it could be an octal number, a decimal in
0.13 disguise, or a hexadecimal number, or a binary number. */
@ -13074,16 +13082,8 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp)
}
break;
/* if it starts with a v, it could be a v-string */
case 'v':
vstring:
sv = newSV(5); /* preallocate storage space */
ENTER_with_name("scan_vstring");
SAVEFREESV(sv);
s = scan_vstring(s, PL_bufend, sv);
SvREFCNT_inc_simple_void_NN(sv);
LEAVE_with_name("scan_vstring");
break;
default:
croak("panic: scan_num, *s=%c", *s);
}
/* make the op for the constant and return */