From b0371d970fac15a414ea15fcf25c20269b4b4f65 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 3 Apr 2025 17:23:43 +0530 Subject: [PATCH] Micro optimization --- kitty/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/screen.c b/kitty/screen.c index 05a20b64f..cc504b639 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -292,8 +292,8 @@ index_selection(const Screen *self, Selections *selections, bool up, index_type const bool needs_special_handling = self->linebuf == self->alt_linebuf && (top > 0 || bottom < self->lines - 1); for (size_t i = 0; i < selections->count; i++) { Selection *s = selections->items + i; - if (is_selection_empty(s)) continue; if (needs_special_handling) { + if (is_selection_empty(s)) continue; int start = (int)s->start.y - s->start_scrolled_by; int end = (int)s->end.y - s->end_scrolled_by; int stop = MIN(start, end);