Skip to content

Commit 690e285

Browse files
committed
toke.c: Convert for(;;;) to simpler while()
isSPACE only matches single-byte characters; no need to be concerned with UTF-8ness
1 parent 526049b commit 690e285

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

toke.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -701,13 +701,11 @@ S_warn_expect_operator(pTHX_ const char *const what, char *s, I32 pop_oldbufptr)
701701
}
702702
else if (PL_oldoldbufptr) {
703703
/* yyerror (via yywarn) would do this itself, so we should too */
704-
const char *t;
705-
for (t = PL_oldoldbufptr;
706-
t < PL_bufptr && isSPACE(*t);
707-
t += UTF ? UTF8SKIP(t) : 1)
708-
{
709-
NOOP;
704+
const char *t = PL_oldoldbufptr;
705+
while (t < PL_bufptr && isSPACE(*t)) {
706+
t++;
710707
}
708+
711709
/* see if we can identify the cause of the warning */
712710
if (isIDFIRST_lazy_if_safe(t,PL_bufend,UTF))
713711
{

0 commit comments

Comments
 (0)