From: Michael Haggerty Date: Fri, 12 Aug 2011 21:43:09 +0000 (+0200) Subject: Change while loop into for loop X-Git-Tag: v1.7.7-rc1~40^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e0a5f9aaae4eea67f513e382d9d917388313d2a6;p=git.git Change while loop into for loop Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/attr.c b/attr.c index a7d1aa95d..b56542e72 100644 --- a/attr.c +++ b/attr.c @@ -228,14 +228,11 @@ static struct match_attr *parse_attr_line(const char *line, const char *src, for (pass = 0; pass < 2; pass++) { /* pass 0 counts and allocates, pass 1 fills */ - num_attr = 0; - cp = states; - while (*cp) { + for (cp = states, num_attr = 0; *cp; num_attr++) { cp = parse_attr(src, lineno, cp, pass ? &(res->state[num_attr]) : NULL); if (!cp) return NULL; - num_attr++; } if (pass) break;