Skip to content

Commit

Permalink
Change while loop into for loop
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael Haggerty authored and Junio C Hamano committed Aug 14, 2011
1 parent 85c4a0d commit e0a5f9a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e0a5f9a

Please sign in to comment.