Skip to content

Commit f203d69

Browse files
drafnelgitster
authored andcommitted
commit.c: rename variable named 'n' which masks previous declaration
The variable named 'n' was initially declared to be of type int. The name 'n' was reused inside inner blocks as a different type. Rename the uses within inner blocks to avoid confusion and give them a slightly more descriptive name. Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1630726 commit f203d69

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

commit.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,13 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
564564
while (interesting(list)) {
565565
struct commit *commit;
566566
struct commit_list *parents;
567-
struct commit_list *n;
567+
struct commit_list *next;
568568
int flags;
569569

570570
commit = list->item;
571-
n = list->next;
571+
next = list->next;
572572
free(list);
573-
list = n;
573+
list = next;
574574

575575
flags = commit->object.flags & (PARENT1 | PARENT2 | STALE);
576576
if (flags == (PARENT1 | PARENT2)) {
@@ -598,11 +598,11 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
598598
free_commit_list(list);
599599
list = result; result = NULL;
600600
while (list) {
601-
struct commit_list *n = list->next;
601+
struct commit_list *next = list->next;
602602
if (!(list->item->object.flags & STALE))
603603
insert_by_date(list->item, &result);
604604
free(list);
605-
list = n;
605+
list = next;
606606
}
607607
return result;
608608
}

0 commit comments

Comments
 (0)