mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-29 08:01:08 +00:00
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: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
8011ec638e
commit
8faba4894c
1 changed files with 3 additions and 5 deletions
|
@ -643,12 +643,10 @@ static void cread_print_hist_list(void)
|
|||
|
||||
#define ERASE_TO_EOL() { \
|
||||
if (num < eol_num) { \
|
||||
int tmp; \
|
||||
for (tmp = num; tmp < eol_num; tmp++) \
|
||||
getcmd_putch(' '); \
|
||||
while (tmp-- > num) \
|
||||
printf("%*s", (int)(eol_num - num), ""); \
|
||||
do { \
|
||||
getcmd_putch(CTL_BACKSPACE); \
|
||||
eol_num = num; \
|
||||
} while (--eol_num > num); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue