{"thread":{"id":"7299","subject":"Trivial cleanup of track_tree_refs()","startedAt":"2007-03-18T20:38:19Z","lastAt":"2007-03-18T20:38:19Z","messageCount":1,"participants":["Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"37399","messageId":"Pine.LNX.4.64.0703181333190.6730@woody.linux-foundation.org","threadId":"7299","inReplyTo":null,"subject":"Trivial cleanup of track_tree_refs()","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-03-18T20:38:19Z","receivedAt":"2007-03-18T20:38:19Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nThis makes \"track_tree_refs()\" use the same \"tree_entry()\" function for \ncounting the entries as it does for actually traversing them a few lines \nlater. \n\nNot a biggie, but the reason I care was that this was the only user of \n\"update_tree_entry()\" that didn't actually *extract* the tree entry first. \nIt doesn't matter as things stand now, but it meant that a separate \ntest-patch I had that avoided a few more \"strlen()\" calls by just saving \nthe entry length in the entry descriptor and using it directly when \nupdating wouldn't work without this patch.\n\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\n---\n tree.c |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\ndiff --git a/tree.c b/tree.c\nindex 46923ee..24f8fb6 100644\n--- a/tree.c\n+++ b/tree.c\n@@ -153,10 +153,8 @@ static void track_tree_refs(struct tree *item)\n \t/* Count how many entries there are.. */\n \tdesc.buf = item->buffer;\n \tdesc.size = item->size;\n-\twhile (desc.size) {\n+\twhile (tree_entry(&desc, &entry))\n \t\tn_refs++;\n-\t\tupdate_tree_entry(&desc);\n-\t}\n \n \t/* Allocate object refs and walk it again.. */\n \ti = 0;\n"}]}