summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-11-06 17:41:18 -0700
committerKarl Williamson <khw@cpan.org>2018-11-16 10:48:18 -0700
commit2ac479f0aebdb9a80e57fb49182be8ddfed7a35f (patch)
treea98f572cdd3b34f4ca4a24a627360a61690a7037 /regcomp.c
parente2fd06413d9a59faa671e09a6c1b3259b8f406e3 (diff)
downloadperl-2ac479f0aebdb9a80e57fb49182be8ddfed7a35f.tar.gz
regcomp.c: Swap 'if' branches for readability
It's easier to understand if the simplest case is first in the code.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/regcomp.c b/regcomp.c
index 7f6bbc81b6..758bc33dd4 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -14101,14 +14101,14 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
if (! FOLD) { /* The simple case, just append the literal */
not_fold_common:
- if (UTF && ! UVCHR_IS_INVARIANT(ender)) {
+ if (UVCHR_IS_INVARIANT(ender) || ! UTF) {
+ *(s++) = (char) ender;
+ }
+ else {
U8 * new_s = uvchr_to_utf8((U8*)s, ender);
added_len = (char *) new_s - s;
s = (char *) new_s;
}
- else {
- *(s++) = (char) ender;
- }
}
else if (LOC && is_PROBLEMATIC_LOCALE_FOLD_cp(ender)) {