From 41a3519ebb9949955cc97c95253a830788ddaf49 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 12 Mar 2025 16:49:12 +0530 Subject: [PATCH] Micro-optimization --- kitty/lineops.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kitty/lineops.h b/kitty/lineops.h index f917fdb5b..1821376b5 100644 --- a/kitty/lineops.h +++ b/kitty/lineops.h @@ -59,9 +59,10 @@ line_reset_cells(Line *line, index_type start, index_type num, GPUCell *gpu_cell static inline bool line_is_empty(const Line *line) { - for (index_type i = 0; i < line->xnum; i++) { - if (line->cpu_cells[i].ch_is_idx || line->cpu_cells[i].ch_or_idx != BLANK_CHAR) return false; - } +#if BLANK_CHAR != 0 +#error This implementation is incorrect for BLANK_CHAR != 0 +#endif + for (index_type i = 0; i < line->xnum; i++) if (line->cpu_cells[i].ch_and_idx) return false; return true; }