diff options
author | Karl Williamson <public@khwilliamson.com> | 2014-01-23 19:50:12 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2014-01-27 23:03:47 -0700 |
commit | 56f7ada6fd347e51c07f3b39dd7b6c3ce2dfb626 (patch) | |
tree | 53d7f9c9c9f99c517617959299278e9a7b9c8b74 /regcomp.c | |
parent | f8d9fdfa27452a1c7a6f46e1eb3ffff866a00ddc (diff) | |
download | perl-56f7ada6fd347e51c07f3b39dd7b6c3ce2dfb626.tar.gz |
regcomp.c: Swap two else clauses for clarity.
This makes one clause mostly positive tests, instead of mostly negative
tests; using positives is easier to understand.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -10813,20 +10813,21 @@ S_alloc_maybe_populate_EXACT(pTHX_ RExC_state_t *pRExC_state, uvchr_to_utf8( character, code_point); len = UTF8SKIP(character); } - } - else if (! FOLD - || code_point != LATIN_SMALL_LETTER_SHARP_S - || ASCII_FOLD_RESTRICTED - || ! AT_LEAST_UNI_SEMANTICS) + } /* Else pattern isn't UTF8. We only fold the sharp s, when + appropriate */ + else if (UNLIKELY(code_point == LATIN_SMALL_LETTER_SHARP_S) + && FOLD + && AT_LEAST_UNI_SEMANTICS + && ! ASCII_FOLD_RESTRICTED) { - *character = (U8) code_point; - len = 1; - } - else { *character = 's'; *(character + 1) = 's'; len = 2; } + else { + *character = (U8) code_point; + len = 1; + } } if (SIZE_ONLY) { |