From a7955c49668dfee4f413747a2fafa6850c6c502a Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Sat, 21 Nov 2020 17:00:58 +0100 Subject: [PATCH] Reduce code duplication --- Panel.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Panel.c b/Panel.c index 68a245e3..7ef1948d 100644 --- a/Panel.c +++ b/Panel.c @@ -330,22 +330,20 @@ bool Panel_onKey(Panel* this, int key) { switch (key) { case KEY_DOWN: case KEY_CTRL('N'): - this->selected++; - break; - case KEY_UP: - case KEY_CTRL('P'): - this->selected--; - break; #ifdef KEY_C_DOWN case KEY_C_DOWN: + #endif this->selected++; break; - #endif + + case KEY_UP: + case KEY_CTRL('P'): #ifdef KEY_C_UP case KEY_C_UP: + #endif this->selected--; break; - #endif + case KEY_LEFT: case KEY_CTRL('B'): if (this->scrollH > 0) {