diff options
author | Karl Williamson <khw@cpan.org> | 2018-11-06 17:41:18 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-11-16 10:48:18 -0700 |
commit | 2ac479f0aebdb9a80e57fb49182be8ddfed7a35f (patch) | |
tree | a98f572cdd3b34f4ca4a24a627360a61690a7037 /regcomp.c | |
parent | e2fd06413d9a59faa671e09a6c1b3259b8f406e3 (diff) | |
download | perl-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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)) { |