Change while loop into for loop
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
85c4a0d048
commit
e0a5f9aaae
5
attr.c
5
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++) {
|
for (pass = 0; pass < 2; pass++) {
|
||||||
/* pass 0 counts and allocates, pass 1 fills */
|
/* pass 0 counts and allocates, pass 1 fills */
|
||||||
num_attr = 0;
|
for (cp = states, num_attr = 0; *cp; num_attr++) {
|
||||||
cp = states;
|
|
||||||
while (*cp) {
|
|
||||||
cp = parse_attr(src, lineno, cp,
|
cp = parse_attr(src, lineno, cp,
|
||||||
pass ? &(res->state[num_attr]) : NULL);
|
pass ? &(res->state[num_attr]) : NULL);
|
||||||
if (!cp)
|
if (!cp)
|
||||||
return NULL;
|
return NULL;
|
||||||
num_attr++;
|
|
||||||
}
|
}
|
||||||
if (pass)
|
if (pass)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue