Trivial cleanup of track_tree_refs()
This makes "track_tree_refs()" use the same "tree_entry()" function for counting the entries as it does for actually traversing them a few lines later. Not a biggie, but the reason I care was that this was the only user of "update_tree_entry()" that didn't actually *extract* the tree entry first. It doesn't matter as things stand now, but it meant that a separate test-patch I had that avoided a few more "strlen()" calls by just saving the entry length in the entry descriptor and using it directly when updating wouldn't work without this patch. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Linus Torvalds committed
Mar 18, 2007 at 13:38 UTC
c711a214c1e9a4dfb5043bc1a11d0f76313b097e
1 file changed
+1
-3
tree.c
+1
-3
@@ -153,10 +153,8 @@ static void track_tree_refs(struct tree *item)
153
/* Count how many entries there are.. */
154
desc.buf = item->buffer;
155
desc.size = item->size;
156
- while (desc.size) {
156
+ while (tree_entry(&desc, &entry))
157
n_refs++;
158
- update_tree_entry(&desc);
159
- }
158
159
/* Allocate object refs and walk it again.. */
160
i = 0;