Skip to content
Snippets Groups Projects
Commit 8faba489 authored by Mike Frysinger's avatar Mike Frysinger Committed by Wolfgang Denk
Browse files

cmd editing: optimize/shrink output blanking


No need to output spaces 1 char at a time in a loop when the printf code
can do the same thing with the right format string.  This shrinks things
and gives a nice speed up when killing off lines more than a byte or two
as printf will send out the buffer in one big chunk.

Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent 8011ec63
No related branches found
No related tags found
No related merge requests found
...@@ -643,12 +643,10 @@ static void cread_print_hist_list(void) ...@@ -643,12 +643,10 @@ static void cread_print_hist_list(void)
#define ERASE_TO_EOL() { \ #define ERASE_TO_EOL() { \
if (num < eol_num) { \ if (num < eol_num) { \
int tmp; \ printf("%*s", (int)(eol_num - num), ""); \
for (tmp = num; tmp < eol_num; tmp++) \ do { \
getcmd_putch(' '); \
while (tmp-- > num) \
getcmd_putch(CTL_BACKSPACE); \ getcmd_putch(CTL_BACKSPACE); \
eol_num = num; \ } while (--eol_num > num); \
} \ } \
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment