From efad733cc549a1880062b32e02a12303e887352f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 30 Jun 2019 18:42:20 +0530 Subject: [PATCH] DRYer --- kitty/core_text.m | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kitty/core_text.m b/kitty/core_text.m index 0210f5e1c..bd67a254f 100644 --- a/kitty/core_text.m +++ b/kitty/core_text.m @@ -197,12 +197,8 @@ manually_search_fallback_fonts(CTFontRef current_font, CPUCell *cell) { char_type ch = cell->ch ? cell->ch : ' '; bool found = true; if (!glyph_id_for_codepoint_ctfont(new_font, ch)) found = false; - if (found && cell->cc_idx[0]) { - ch = codepoint_for_mark(cell->cc_idx[0]); - if (!glyph_id_for_codepoint_ctfont(new_font, ch)) found = false; - } - if (found && cell->cc_idx[1]) { - ch = codepoint_for_mark(cell->cc_idx[1]); + for (unsigned i = 0; i < arraysz(cell->cc_idx) && cell->cc_idx[i] && found; i++) { + ch = codepoint_for_mark(cell->cc_idx[i]); if (!glyph_id_for_codepoint_ctfont(new_font, ch)) found = false; } if (found) {