From 52e6a751b3cf424dddb98ad822c8cb13c1bf6a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 17 May 2020 15:48:58 +0200 Subject: [PATCH] term: scrolling: mark selection top if-statement as 'unlikely' --- terminal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terminal.c b/terminal.c index de8d7146..7229506c 100644 --- a/terminal.c +++ b/terminal.c @@ -1748,8 +1748,8 @@ term_scroll_partial(struct terminal *term, struct scroll_region region, int rows rows = min(rows, region.end - region.start); /* Cancel selections that cannot be scrolled */ - if (term->selection.start.row != -1) { - if (term->selection.end.row != -1) { + if (unlikely(term->selection.start.row != -1)) { + if (likely(term->selection.end.row != -1)) { /* * Selection is (partly) inside either the top or bottom * scrolling regions, or on (at least one) of the lines @@ -1820,8 +1820,8 @@ term_scroll_reverse_partial(struct terminal *term, rows = min(rows, region.end - region.start); /* Cancel selections that cannot be scrolled */ - if (term->selection.start.row != -1) { - if (term->selection.end.row != -1) { + if (unlikely(term->selection.start.row != -1)) { + if (likely(term->selection.end.row != -1)) { /* * Selection is (partly) inside either the top or bottom * scrolling regions, or on (at least one) of the lines