From: Karl Williamson Date: Fri, 24 Jan 2014 02:50:12 +0000 (-0700) Subject: regcomp.c: Swap two else clauses for clarity. X-Git-Tag: upstream/5.20.0~601 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56f7ada6fd347e51c07f3b39dd7b6c3ce2dfb626;p=platform%2Fupstream%2Fperl.git 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. --- 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) {