From e6c629951f321fe1f932cace76529b2512c202ae Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 23 Jun 2019 20:40:22 +0200 Subject: [PATCH] display: use a somewhat faster method to clear a row On an 80-column terminal, using a single printw() instead of a loop of addch() reduces the time taken with 13 percent. --- src/winio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/winio.c b/src/winio.c index 996a1988..2f568af7 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1794,10 +1794,7 @@ const keystruct *get_shortcut(int *kbinput) * current attributes. */ void blank_row(WINDOW *win, int y, int x, int n) { - wmove(win, y, x); - - for (; n > 0; n--) - waddch(win, ' '); + mvwprintw(win, y, x, "%*s", n, " "); } /* Blank the first line of the top portion of the window. */