From f5a7d9160326e95b3bde9fa4fa835c871cf92c55 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 14 Feb 2025 21:17:18 +0530 Subject: [PATCH] Simplify condition --- kitty/fonts.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kitty/fonts.c b/kitty/fonts.c index 24abd89ea..adb7dac40 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -577,12 +577,11 @@ face_has_codepoint(const void* face, char_type cp) { static bool has_emoji_presentation(const CPUCell *c, const ListOfChars *lc) { - bool ans = c->is_multicell && lc->count && is_emoji(lc->chars[0]); - if (ans) { - if (is_narrow_emoji(lc->chars[0])) ans = lc->count > 1 && lc->chars[1] == VS16; - else ans = lc->count == 1 || lc->chars[1] != VS15; - } - return ans; + bool is_text_presentation; + return c->is_multicell && lc->count && is_emoji(lc->chars[0]) && ( + ( (is_text_presentation = is_narrow_emoji(lc->chars[0])) && lc->count > 1 && lc->chars[1] == VS16 ) || + ( !is_text_presentation && (lc->count == 1 || lc->chars[1] != VS15) ) + ); } bool