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.
This commit is contained in:
Karl Williamson 2025-10-02 16:06:49 -06:00 committed by Karl Williamson
parent 690e285d14
commit cdde901d86

7
toke.c
View File

@ -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)