summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-03-31 08:40:25 -0600
committerKarl Williamson <khw@cpan.org>2022-04-01 09:25:36 -0600
commita3ccbff349554ef2ae3d50f7ff0e1b4e830933bd (patch)
tree578b05ba0a05aa8be7c44e4891b2719827b993d7 /toke.c
parentc9243525b41868696263f5cf466b73718e734a99 (diff)
downloadperl-a3ccbff349554ef2ae3d50f7ff0e1b4e830933bd.tar.gz
toke.c: Reorder branches for clarity
The trivial case should be handled first.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toke.c b/toke.c
index 6264c5c612..369fa72978 100644
--- a/toke.c
+++ b/toke.c
@@ -11535,7 +11535,10 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int
}
/* Here, still in the middle of the string; copy this character */
- if (UTF && ! UTF8_IS_INVARIANT((U8) *s)) {
+ if (! UTF || UTF8_IS_INVARIANT((U8) *s)) {
+ *to++ = *s++;
+ }
+ else {
size_t this_char_len = UTF8SKIP(s);
Copy(s, to, this_char_len, char);
s += this_char_len;
@@ -11543,9 +11546,6 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int
d_is_utf8 = TRUE;
}
- else {
- *to++ = *s++;
- }
} /* End of loop through buffer */
/* Here, found end of the string, OR ran out of buffer: terminate the