Merge pull request #122 from monaka/pr-simplify-peek_n-20110512

Simplify while loop in peek_n().
This commit is contained in:
Yukihiro "Matz" Matsumoto
2012-05-12 02:40:32 -07:00
+2 -3
View File
@@ -3056,12 +3056,11 @@ peek_n(parser_state *p, int c, int n)
node *list = 0;
int c0;
n++; /* must read 1 char */
while (n--) {
do {
c0 = nextc(p);
if (c0 < 0) return FALSE;
list = push(list, (node*)(intptr_t)c0);
}
} while(n--);
if (p->pb) {
p->pb = push(p->pb, (node*)list);
}