summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-06-25 13:09:08 -0600
committerKarl Williamson <khw@cpan.org>2021-08-14 06:47:43 -0600
commit22f363ffd253b5142b1138438c30f34da9494d4a (patch)
treea02ca691b6818aafce1300ab4cdd3706ff7c4087 /utf8.c
parent22afef87083fc7ad1b066588f5c20637fd387805 (diff)
downloadperl-22f363ffd253b5142b1138438c30f34da9494d4a.tar.gz
Make macro isUTF8_CHAR_flags an inline fcn
This makes it use the fast DFA for this functionality.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index c78ce84ab5..7f26c8645c 100644
--- a/utf8.c
+++ b/utf8.c
@@ -817,7 +817,10 @@ Perl_is_utf8_char_helper(const U8 * const s, const U8 * e, const U32 flags)
assert(0 == (flags & ~(UTF8_DISALLOW_ILLEGAL_INTERCHANGE
|UTF8_DISALLOW_PERL_EXTENDED)));
- assert(! UTF8_IS_INVARIANT(*s));
+
+ if (UTF8_IS_INVARIANT(*s)) {
+ return 1;
+ }
/* A variant char must begin with a start byte */
if (UNLIKELY(! UTF8_IS_START(*s))) {