From: René Scharfe Date: Thu, 4 Jan 2007 18:33:36 +0000 (+0100) Subject: Remove shadowing variable from traverse_trees() X-Git-Tag: v1.5.0-rc1~93 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4fe2cc0c8906ba6d39c4fab89fe88dcf2226b184;p=git.git Remove shadowing variable from traverse_trees() The variable named entry is allocated using malloc() and then forgotten, it being shadowed by an automatic variable of the same name. Fixing the array size at 3 worked so far because the only caller of traverse_trees() needed only as much entries. Simply remove the shadowing varaible and we're able to traverse more than three trees and save stack space at the same time! Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff --git a/tree-walk.c b/tree-walk.c index 14cc5aea6..22f4550b6 100644 --- a/tree-walk.c +++ b/tree-walk.c @@ -113,7 +113,6 @@ void traverse_trees(int n, struct tree_desc *t, const char *base, traverse_callb struct name_entry *entry = xmalloc(n*sizeof(*entry)); for (;;) { - struct name_entry entry[3]; unsigned long mask = 0; int i, last;