From fa481efe8e777bae2c2cca3649176d1ac7da6413 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 14 Apr 2024 23:03:25 +0200 Subject: Reorganize some things --- lib/unicode/string/u8upper.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'lib/unicode/string') diff --git a/lib/unicode/string/u8upper.c b/lib/unicode/string/u8upper.c index 5ce0e77..6b041f6 100644 --- a/lib/unicode/string/u8upper.c +++ b/lib/unicode/string/u8upper.c @@ -8,17 +8,14 @@ u8upper(char8_t *restrict dst, size_t dstn, const char8_t *src, size_t srcn, { struct ucctx ctx = { .az_or_tr = flags & CF_LANG_AZ, - .cap_eszett = flags & CF_ẞ, + .lt = flags & CF_LANG_LT, + .ẞ = flags & CF_ẞ, }; rune ch; size_t n = 0; - bool prev_was_i = false; while (u8next(&ch, &src, &srcn)) { - if (ch == 0x307 && prev_was_i && (flags & CF_LANG_LT)) - ctx.lt_after_i = true; - struct rview rv = uprop_get_uc(ch, ctx); for (size_t i = 0; i < rv.len; i++) { if (n >= dstn) { @@ -27,9 +24,7 @@ u8upper(char8_t *restrict dst, size_t dstn, const char8_t *src, size_t srcn, } else n += rtou8(dst + n, dstn - n, rv.p[i]); } - - prev_was_i = ch == 'i'; - ctx.lt_after_i = false; + ctx.after_i = ch == 'i'; } return n; -- cgit v1.2.3