Micro optimization

This commit is contained in:
Kovid Goyal 2025-04-03 17:23:43 +05:30
parent 251ec3419b
commit b0371d970f
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -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);