summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2007-03-18 20:38:19 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-03-19 08:48:56 (GMT)
commitc711a214c1e9a4dfb5043bc1a11d0f76313b097e (patch)
tree756bb7cadfd1c31da74d5ce18cfdd489f7081251
parentd55552f6e3b63ab6f33dd61071760bee42b9bc5e (diff)
downloadgit-c711a214c1e9a4dfb5043bc1a11d0f76313b097e.zip
git-c711a214c1e9a4dfb5043bc1a11d0f76313b097e.tar.gz
git-c711a214c1e9a4dfb5043bc1a11d0f76313b097e.tar.bz2
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>
-rw-r--r--tree.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tree.c b/tree.c
index 46923ee..24f8fb6 100644
--- a/tree.c
+++ b/tree.c
@@ -153,10 +153,8 @@ static void track_tree_refs(struct tree *item)
/* Count how many entries there are.. */
desc.buf = item->buffer;
desc.size = item->size;
- while (desc.size) {
+ while (tree_entry(&desc, &entry))
n_refs++;
- update_tree_entry(&desc);
- }
/* Allocate object refs and walk it again.. */
i = 0;