Skip to content

Commit 656be9b

Browse files
committed
toke.c: Replace for() with simpler do while()
It is a bit simpler
1 parent cdde901 commit 656be9b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

toke.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -710,13 +710,14 @@ S_warn_expect_operator(pTHX_ const char *const what, char *s, I32 pop_oldbufptr)
710710
Size_t advance;
711711
if ((advance = isIDFIRST_lazy_if_safe(t, PL_bufend, UTF))) {
712712
const char *t_start = t;
713-
t += advance;
714-
for ( ;
715-
(isWORDCHAR_lazy_if_safe(t, PL_bufend, UTF) || *t == ':');
716-
t += UTF ? UTF8SKIP(t) : 1)
717-
{
718-
NOOP;
713+
do {
714+
t += advance;
719715
}
716+
while ( (advance = (*t == ':'))
717+
|| (advance = isWORDCHAR_lazy_if_safe((U8 *) t,
718+
(U8 *) PL_bufend,
719+
UTF)));
720+
720721
if (t < PL_bufptr && isSPACE(*t)) {
721722
has_more = TRUE;
722723
sv_catpvf( message,

0 commit comments

Comments
 (0)