diff options
author | Karl Williamson <khw@cpan.org> | 2018-05-20 12:52:17 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-06-25 08:16:09 -0600 |
commit | d5af40bf9ec730a9e04c5eb18a4df7c10c69d621 (patch) | |
tree | a260a3b8ef100109f5ecca2d3dc028583f832921 | |
parent | 470e8f06c2e98a707d7624050b480c1efd95d619 (diff) | |
download | perl-d5af40bf9ec730a9e04c5eb18a4df7c10c69d621.tar.gz |
toke.c: Move some code into called function
It makes more sense for this code to be in the function called, rather
than separated out.
-rw-r--r-- | regexec.c | 9 | ||||
-rw-r--r-- | toke.c | 12 |
2 files changed, 10 insertions, 11 deletions
@@ -10160,7 +10160,14 @@ Perl__is_grapheme(pTHX_ const U8 * strbeg, const U8 * s, const U8 * strend, cons PERL_ARGS_ASSERT__IS_GRAPHEME; - /* Unassigned code points are forbidden */ + if ( UNLIKELY(UNICODE_IS_SUPER(cp)) + || UNLIKELY(UNICODE_IS_NONCHAR(cp))) + { + /* These are considered graphemes */ + return TRUE; + } + + /* Otherwise, unassigned code points are forbidden */ if (UNLIKELY(! ELEMENT_RANGE_MATCHES_INVLIST( _invlist_search(PL_Assigned_invlist, cp)))) { @@ -10639,16 +10639,8 @@ S_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int re } else { termcode = utf8_to_uvchr_buf((U8*)s, (U8*)PL_bufend, &termlen); - if (check_grapheme) { - if ( UNLIKELY(UNICODE_IS_SUPER(termcode)) - || UNLIKELY(UNICODE_IS_NONCHAR(termcode))) - { - /* These are considered graphemes, and since the ending - * delimiter will be the same, we don't have to check the other - * end */ - check_grapheme = FALSE; - } - else if (UNLIKELY(! _is_grapheme((U8 *) start, + if (UTF) { + if (UNLIKELY(! _is_grapheme((U8 *) start, (U8 *) s, (U8 *) PL_bufend, termcode))) |