diff options
author | Denys Vlasenko | 2018-12-13 21:31:29 +0100 |
---|---|---|
committer | Denys Vlasenko | 2018-12-13 21:31:29 +0100 |
commit | 89198a9e5d4e599a25a839c4d193f834bcd8c617 (patch) | |
tree | 60817eeb7654201417d13bff7f14cc624bcd7cb4 /miscutils/bc.c | |
parent | bbcecc4118416390571170868447fd2773a741bd (diff) | |
download | busybox-89198a9e5d4e599a25a839c4d193f834bcd8c617.zip busybox-89198a9e5d4e599a25a839c4d193f834bcd8c617.tar.gz |
bc: simplify bc_lex_whitespace()
function old new delta
bc_lex_whitespace 52 41 -11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils/bc.c')
-rw-r--r-- | miscutils/bc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c index a271a20..5938e54 100644 --- a/miscutils/bc.c +++ b/miscutils/bc.c @@ -2790,9 +2790,13 @@ static void bc_lex_lineComment(BcLex *l) static void bc_lex_whitespace(BcLex *l) { - char c; l->t.t = BC_LEX_WHITESPACE; - for (c = l->buf[l->i]; c != '\n' && isspace(c); c = l->buf[++l->i]); + for (;;) { + char c = l->buf[l->i]; + if (c == '\n' || !isspace(c)) + break; + l->i++; + } } static BC_STATUS zbc_lex_number(BcLex *l, char start) |