projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbcecc4
)
bc: simplify bc_lex_whitespace()
author
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 13 Dec 2018 20:31:29 +0000
(21:31 +0100)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 13 Dec 2018 20:31:29 +0000
(21:31 +0100)
function old new delta
bc_lex_whitespace 52 41 -11
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/bc.c
patch
|
blob
|
history
diff --git
a/miscutils/bc.c
b/miscutils/bc.c
index a271a20407c77a1606910f8bc9b7370de3708f58..5938e54abfb9beab127677ccc027c4fb3fc269d5 100644
(file)
--- 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)