Simplify condition

This commit is contained in:
Kovid Goyal
2025-02-14 21:17:18 +05:30
parent 61edc2aef7
commit f5a7d91603

View File

@@ -577,12 +577,11 @@ face_has_codepoint(const void* face, char_type cp) {
static bool static bool
has_emoji_presentation(const CPUCell *c, const ListOfChars *lc) { has_emoji_presentation(const CPUCell *c, const ListOfChars *lc) {
bool ans = c->is_multicell && lc->count && is_emoji(lc->chars[0]); bool is_text_presentation;
if (ans) { return c->is_multicell && lc->count && is_emoji(lc->chars[0]) && (
if (is_narrow_emoji(lc->chars[0])) ans = lc->count > 1 && lc->chars[1] == VS16; ( (is_text_presentation = is_narrow_emoji(lc->chars[0])) && lc->count > 1 && lc->chars[1] == VS16 ) ||
else ans = lc->count == 1 || lc->chars[1] != VS15; ( !is_text_presentation && (lc->count == 1 || lc->chars[1] != VS15) )
} );
return ans;
} }
bool bool