Skip to content

Commit cdde901

Browse files
committed
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.
1 parent 690e285 commit cdde901

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

toke.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,9 +707,10 @@ S_warn_expect_operator(pTHX_ const char *const what, char *s, I32 pop_oldbufptr)
707707
}
708708

709709
/* see if we can identify the cause of the warning */
710-
if (isIDFIRST_lazy_if_safe(t,PL_bufend,UTF))
711-
{
712-
const char *t_start= t;
710+
Size_t advance;
711+
if ((advance = isIDFIRST_lazy_if_safe(t, PL_bufend, UTF))) {
712+
const char *t_start = t;
713+
t += advance;
713714
for ( ;
714715
(isWORDCHAR_lazy_if_safe(t, PL_bufend, UTF) || *t == ':');
715716
t += UTF ? UTF8SKIP(t) : 1)

0 commit comments

Comments
 (0)