summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d55552f)
raw | patch | inline | side by side (parent: d55552f)
author | Linus Torvalds <torvalds@linux-foundation.org> | |
Sun, 18 Mar 2007 20:38:19 +0000 (13:38 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 19 Mar 2007 08:48:56 +0000 (01:48 -0700) |
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>
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>
tree.c | patch | blob | history |
index 46923ee61bcce99e677abcc37e233359d39cc9fc..24f8fb676650ff0c95baffe79966219fa026f09f 100644 (file)
--- a/tree.c
+++ b/tree.c
/* 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;