From 40bf70fb8f23e5ff7212b568c69e0725372e5b57 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 28 Jan 2026 22:03:48 +0100 Subject: Clean up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libcharconv_sans_serif.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'libcharconv_sans_serif.c') diff --git a/libcharconv_sans_serif.c b/libcharconv_sans_serif.c index 787d14b..4edf373 100644 --- a/libcharconv_sans_serif.c +++ b/libcharconv_sans_serif.c @@ -10,16 +10,10 @@ libcharconv_sans_serif(const char *s, size_t slen, size_t *n, uint_least32_t *cp *n = 0; for (; slen--; s++) { old_slen = slen; - if ('A' <= *s && *s <= 'Z') { - c = (uint_least32_t)(UINT32_C(0x1D5A0) + (unsigned)(*s - 'A')); - goto conv; - } else if ('a' <= *s && *s <= 'z') { - c = (uint_least32_t)(UINT32_C(0x1D5BA) + (unsigned)(*s - 'a')); - goto conv; - } else if ('0' <= *s && *s <= '9') { - c = (uint_least32_t)(UINT32_C(0x1D7E2) + (unsigned)(*s - '0')); - goto conv; - } else if ((unsigned char)s[0] == 0xE2u) { + PLAIN_RANGE('A', 'Z', 0x1D5A0); + PLAIN_RANGE('a', 'z', 0x1D5BA); + PLAIN_RANGE('0', '9', 0x1D7E2); + if ((unsigned char)s[0] == 0xE2u) { if (!slen--) goto indeterminate; if ((unsigned char)s[1] == 0x93u) { -- cgit v1.2.3-70-g09d2