commit 572247dbd83c750346d8e070ff1b675b47e2c4f9
parent c5a0e6b60c4eea14daae5b5b739020b6e35d2204
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 22 Jul 2024 12:03:04 +0200
tweaks: reshuffle a seldom-used function to the end of an if-else series
Diffstat:
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/browser.c b/src/browser.c
@@ -493,7 +493,7 @@ char *browse(char *path)
#endif
function = interpret(kbinput);
- if (function == full_refresh || function == do_help) {
+ if (function == do_help || function == full_refresh) {
function();
#ifndef NANO_TINY
/* Simulate a terminal resize to force a directory reread,
diff --git a/src/help.c b/src/help.c
@@ -486,10 +486,8 @@ void show_help(void)
#endif
function = interpret(kbinput);
- if (function == full_refresh) {
- full_refresh();
- } else if (ISSET(SHOW_CURSOR) && (function == do_left || function == do_right ||
- function == do_up || function == do_down)) {
+ if (ISSET(SHOW_CURSOR) && (function == do_left || function == do_right ||
+ function == do_up || function == do_down)) {
function();
} else if (function == do_up || function == do_scroll_up) {
do_scroll_up();
@@ -516,6 +514,8 @@ void show_help(void)
} else if (kbinput == THE_WINDOW_RESIZED) {
; /* Nothing to do. */
#endif
+ } else if (function == full_refresh) {
+ full_refresh();
} else if (function == do_exit) {
break;
} else