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_chess_black.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'libcharconv_chess_black.c') diff --git a/libcharconv_chess_black.c b/libcharconv_chess_black.c index 906c2f7..480c872 100644 --- a/libcharconv_chess_black.c +++ b/libcharconv_chess_black.c @@ -7,26 +7,11 @@ libcharconv_chess_black(const char *s, size_t slen, size_t *n, uint_least32_t *c { uint_least32_t c; *n = 0; - for (; slen--; s++) { - switch (*s) { - case 'K': c = UINT32_C(0x2654); goto conv; - case 'Q': c = UINT32_C(0x2655); goto conv; - case 'R': c = UINT32_C(0x2656); goto conv; - case 'B': c = UINT32_C(0x2657); goto conv; - case 'N': c = UINT32_C(0x2658); goto conv; - case 'P': c = UINT32_C(0x2659); goto conv; - case 'E': c = UINT32_C(0x1FA48); goto conv; - case 'k': c = UINT32_C(0x265A); goto conv; - case 'q': c = UINT32_C(0x265B); goto conv; - case 'r': c = UINT32_C(0x265C); goto conv; - case 'b': c = UINT32_C(0x265D); goto conv; - case 'n': c = UINT32_C(0x265E); goto conv; - case 'p': c = UINT32_C(0x265F); goto conv; - case 'e': c = UINT32_C(0x1FA49); goto conv; - default: - *n += 1u; - break; - } + for (; slen--; s++, ++*n) { + PLAIN_SELECT("KQRBNP", 0x2654); + PLAIN_SELECT("kqrbnp", 0x265A); + PLAIN_SINGLE('E', 0x1FA48); + PLAIN_SINGLE('e', 0x1FA49); } no_conv: return LIBCHARCONV_NO_CONVERT; -- cgit v1.2.3-70-g09d2