From 8c1024baa9c0cf407cc5d3d009e5744d413ea1e8 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 3 Nov 2025 04:21:12 -0700 Subject: [PATCH] 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. --- toke.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/toke.c b/toke.c index c14dc0d477..32fe3cf97b 100644 --- a/toke.c +++ b/toke.c @@ -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 */