From: David Griffith Date: Tue, 12 Feb 2019 12:21:48 +0000 (-0800) Subject: Unroll ternary operator with unix_history functions. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=225d8d38b7e21deaa9138d5d332870c8afcb1682;p=liskon_frotz.git Unroll ternary operator with unix_history functions. --- diff --git a/src/curses/ux_input.c b/src/curses/ux_input.c index 542ffd0..3c842b3 100644 --- a/src/curses/ux_input.c +++ b/src/curses/ux_input.c @@ -608,12 +608,14 @@ zchar os_read_line (int bufmax, zchar *buf, int timeout, int width, case ZC_ARROW_UP: case ZC_ARROW_DOWN: if (searchpos < 0) searchpos = len; - if ((ch == ZC_ARROW_UP ? unix_history_back : unix_history_forward) - (buf, searchpos, max)) { - scrnset(x, ' ', len); - mvaddstr(y, x, (char *) buf); - scrpos = len = strlen((char *) buf); - } + if (ch == ZC_ARROW_UP) + unix_history_back(buf, searchpos, max); + else + unix_history_forward(buf, searchpos, max); + + scrnset(x, ' ', len); + mvaddstr(y, x, (char *) buf); + scrpos = len = strlen((char *) buf); continue; /* Passthrough as up/down arrows for Beyond Zork. */