From fa95265eaa8c1d7f41dc537f44450b142247253e Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 26 Apr 2024 22:22:27 +0200 Subject: Only compute before_dot or more_above for AZ/TR/LT --- lib/unicode/string/u8lower.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'lib') diff --git a/lib/unicode/string/u8lower.c b/lib/unicode/string/u8lower.c index f9ac78c..f59cf39 100644 --- a/lib/unicode/string/u8lower.c +++ b/lib/unicode/string/u8lower.c @@ -35,23 +35,25 @@ u8lower(char8_t *restrict dst, size_t dstn, const char8_t *src, size_t srcn, if (srcn > 0) u8tor(&next, src); - if (before_dot_cnt == 0 || more_above_cnt == 0) { - rune ch = 0; - before_dot_cnt = more_above_cnt = 0; - struct u8view cpy = {src, srcn}; - - do { - before_dot_cnt++; - more_above_cnt++; - } while (u8next(&ch ,U8_ARGSP(cpy)) && !uprop_ccc_0_or_230(ch)); - - if (ch != COMB_DOT_ABOVE) - before_dot_cnt = 0; - if (uprop_get_ccc(ch) != 230) - more_above_cnt = 0; - } else { - before_dot_cnt--; - more_above_cnt--; + if (ctx.az_or_tr || ctx.lt) { + if (before_dot_cnt == 0 || more_above_cnt == 0) { + rune ch = 0; + before_dot_cnt = more_above_cnt = 0; + struct u8view cpy = {src, srcn}; + + do { + before_dot_cnt++; + more_above_cnt++; + } while (u8next(&ch, U8_ARGSP(cpy)) && !uprop_ccc_0_or_230(ch)); + + if (ch != COMB_DOT_ABOVE) + before_dot_cnt = 0; + if (uprop_get_ccc(ch) != 230) + more_above_cnt = 0; + } else { + before_dot_cnt--; + more_above_cnt--; + } } if (final_sigma.after == 0) { -- cgit v1.2.3