From 56f7ada6fd347e51c07f3b39dd7b6c3ce2dfb626 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 23 Jan 2014 19:50:12 -0700 Subject: [PATCH] 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. --- regcomp.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/regcomp.c b/regcomp.c index 6be379e..97a5490 100644 --- a/regcomp.c +++ b/regcomp.c @@ -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) { -- 2.7.4