summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-05-20 12:52:17 -0600
committerKarl Williamson <khw@cpan.org>2018-06-25 08:16:09 -0600
commitd5af40bf9ec730a9e04c5eb18a4df7c10c69d621 (patch)
treea260a3b8ef100109f5ecca2d3dc028583f832921
parent470e8f06c2e98a707d7624050b480c1efd95d619 (diff)
downloadperl-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.c9
-rw-r--r--toke.c12
2 files changed, 10 insertions, 11 deletions
diff --git a/regexec.c b/regexec.c
index 56d5b10fd8..7ed8f4fabc 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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))))
{
diff --git a/toke.c b/toke.c
index fc87252bb1..66a02e2a04 100644
--- a/toke.c
+++ b/toke.c
@@ -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)))