Skip to content

Commit 5879929

Browse files
committed
toke.c: Swap order of some conditionals
It's better to test the fast things before the slow things
1 parent f24d057 commit 5879929

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

toke.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -714,10 +714,10 @@ S_warn_expect_operator(pTHX_ const char *const what, char *s, I32 pop_oldbufptr)
714714
do {
715715
t += advance;
716716
}
717-
while ( (advance = isIDCONT_lazy_if_safe((U8 *) t,
717+
while ( (advance = (*t == ':'))
718+
|| (advance = isIDCONT_lazy_if_safe((U8 *) t,
718719
(U8 *) PL_bufend,
719-
UTF))
720-
|| (advance = (*t == ':')));
720+
UTF)));
721721

722722
if (t < PL_bufptr && isSPACE(*t)) {
723723
has_more = TRUE;
@@ -2090,8 +2090,8 @@ S_check_uni(pTHX)
20902090
PL_last_uni++;
20912091
s = PL_last_uni;
20922092
Size_t advance;
2093-
while ( (advance = isWORDCHAR_lazy_if_safe(s, PL_bufend, UTF))
2094-
|| (advance = (*s == '-')))
2093+
while ( (advance = (*s == '-'))
2094+
|| (advance = isWORDCHAR_lazy_if_safe(s, PL_bufend, UTF)))
20952095
s += advance;
20962096
if (s < PL_bufptr && memchr(s, '(', PL_bufptr - s))
20972097
return;

0 commit comments

Comments
 (0)