From b60237fe9105febf5792c372a5ee41084f5e8431 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 13 Apr 2024 00:08:01 +0200 Subject: Use ternary expressions --- lib/unicode/prop/uprop_get_tc.c | 5 +---- lib/unicode/prop/uprop_get_uc.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/unicode/prop') diff --git a/lib/unicode/prop/uprop_get_tc.c b/lib/unicode/prop/uprop_get_tc.c index 3c957cf..c4c8070 100644 --- a/lib/unicode/prop/uprop_get_tc.c +++ b/lib/unicode/prop/uprop_get_tc.c @@ -70,8 +70,5 @@ uprop_get_tc(rune ch, struct tcctx ctx) return M(); rune CH = uprop_get_stc(ch); - if (ch != CH) - return M(CH); - - return mlib_lookup_kv(ch); + return ch != CH ? M(CH) : mlib_lookup_kv(ch); } diff --git a/lib/unicode/prop/uprop_get_uc.c b/lib/unicode/prop/uprop_get_uc.c index 724e034..c1ddf87 100644 --- a/lib/unicode/prop/uprop_get_uc.c +++ b/lib/unicode/prop/uprop_get_uc.c @@ -127,8 +127,5 @@ uprop_get_uc(rune ch, struct ucctx ctx) return M(); rune CH = uprop_get_suc(ch); - if (ch != CH) - return M(CH); - - return mlib_lookup_kv(ch); + return ch != CH ? M(CH) : mlib_lookup_kv(ch); } -- cgit v1.2.3