From 40d122dedea41994dc227d2a3a5846d7e51ce3b4 Mon Sep 17 00:00:00 2001 From: Masaki Muranaka Date: Sat, 12 May 2012 14:21:06 +0900 Subject: Simplify while loop in peek_n(). --- src/parse.y | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/parse.y b/src/parse.y index 5bce579e7..4c339f0f4 100644 --- a/src/parse.y +++ b/src/parse.y @@ -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); } -- cgit v1.2.3