From cdde901d86fb8260e70dd4d4f11e78f7ec5f5483 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 2 Oct 2025 16:06:49 -0600 Subject: [PATCH] toke.c: Avoid a loop iteration By using the output of the first macro, and skipping ahead in the parse string, we avoid reparsing the same bytes. --- toke.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/toke.c b/toke.c index 21d1ceab00..b58817103e 100644 --- a/toke.c +++ b/toke.c @@ -707,9 +707,10 @@ S_warn_expect_operator(pTHX_ const char *const what, char *s, I32 pop_oldbufptr) } /* see if we can identify the cause of the warning */ - if (isIDFIRST_lazy_if_safe(t,PL_bufend,UTF)) - { - const char *t_start= t; + Size_t advance; + if ((advance = isIDFIRST_lazy_if_safe(t, PL_bufend, UTF))) { + const char *t_start = t; + t += advance; for ( ; (isWORDCHAR_lazy_if_safe(t, PL_bufend, UTF) || *t == ':'); t += UTF ? UTF8SKIP(t) : 1)