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_shogi.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'libcharconv_shogi.c') diff --git a/libcharconv_shogi.c b/libcharconv_shogi.c index d12f158..66604c5 100644 --- a/libcharconv_shogi.c +++ b/libcharconv_shogi.c @@ -7,16 +7,11 @@ libcharconv_shogi(const char *s, size_t slen, size_t *n, uint_least32_t *cp, siz { uint_least32_t c; *n = 0; - for (; slen--; s++) { - switch (*s) { - case 'w': c = UINT32_C(0x2616); goto conv; - case 'b': c = UINT32_C(0x2617); goto conv; - case 'W': c = UINT32_C(0x26C9); goto conv; - case 'B': c = UINT32_C(0x26CA); goto conv; - default: - *n += 1u; - break; - } + for (; slen--; s++, ++*n) { + PLAIN_SINGLE('w', 0x2616); + PLAIN_SINGLE('b', 0x2617); + PLAIN_SINGLE('W', 0x2619); + PLAIN_SINGLE('B', 0x261A); } no_conv: return LIBCHARCONV_NO_CONVERT; -- cgit v1.2.3-70-g09d2