Change while loop into for loop
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Aug 12, 2011 at 23:43 UTC
e0a5f9aaae4eea67f513e382d9d917388313d2a6
1 file changed
+1
-4
attr.c
+1
-4
@@ -228,14 +228,11 @@ static struct match_attr *parse_attr_line(const char *line, const char *src,
228
229
for (pass = 0; pass < 2; pass++) {
230
/* pass 0 counts and allocates, pass 1 fills */
231
- num_attr = 0;
232
- cp = states;
233
- while (*cp) {
231
+ for (cp = states, num_attr = 0; *cp; num_attr++) {
232
cp = parse_attr(src, lineno, cp,
233
pass ? &(res->state[num_attr]) : NULL);
234
if (!cp)
235
return NULL;
238
- num_attr++;
236
}
237
if (pass)
238
break;