Skip to content

Commit 1067e02

Browse files
committed
isUTF8_CHAR: Remove a conditional from a loop
Instead, this follows the paradigm of d4e2765.
1 parent 012637a commit 1067e02

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

inline.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,16 +2250,15 @@ Perl_is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el)
22502250
\
22512251
do { \
22522252
state = dfa_tab[256 + state + dfa_tab[*s8dfa_]]; \
2253-
s8dfa_++; \
2253+
} while (++s8dfa_ < e8dfa_ && state > 1); \
22542254
\
2255-
if (state == 0) { /* Accepting state */ \
2256-
accept_action; \
2257-
} \
2255+
if (LIKELY(state == 0)) { /* Accepting state */ \
2256+
accept_action; \
2257+
} \
22582258
\
2259-
if (UNLIKELY(state == 1)) { /* Rejecting state */ \
2260-
reject_action; \
2261-
} \
2262-
} while (s8dfa_ < e8dfa_); \
2259+
if (state == 1) { /* Rejecting state */ \
2260+
reject_action; \
2261+
} \
22632262
\
22642263
/* Here, dropped out of loop before end-of-char */ \
22652264
incomplete_char_action; \

0 commit comments

Comments
 (0)