{"thread":{"id":"15829","subject":"[PATCH] Cleanup in sha1_file.c::cache_or_unpack_entry()","startedAt":"2008-10-09T00:11:24Z","lastAt":"2008-10-09T00:11:24Z","messageCount":1,"participants":["Miklos Vajna"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"92633","messageId":"1223511084-3472-1-git-send-email-vmiklos@frugalware.org","threadId":"15829","inReplyTo":null,"subject":"[PATCH] Cleanup in sha1_file.c::cache_or_unpack_entry()","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-10-09T00:11:24Z","receivedAt":"2008-10-09T00:11:24Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"This patch just removes an unnecessary goto which makes the code easier\nto read and shorter.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n sha1_file.c |    6 ++----\n 1 files changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/sha1_file.c b/sha1_file.c\nindex 7515987..ea6bd99 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -1571,11 +1571,9 @@ static void *cache_or_unpack_entry(struct packed_git *p, off_t base_offset,\n \tstruct delta_base_cache_entry *ent = delta_base_cache + hash;\n \n \tret = ent->data;\n-\tif (ret && ent->p == p && ent->base_offset == base_offset)\n-\t\tgoto found_cache_entry;\n-\treturn unpack_entry(p, base_offset, type, base_size);\n+\tif (!ret || ent->p != p || ent->base_offset != base_offset)\n+\t\treturn unpack_entry(p, base_offset, type, base_size);\n \n-found_cache_entry:\n \tif (!keep_cache) {\n \t\tent->data = NULL;\n \t\tent->lru.next->prev = ent->lru.prev;\n-- \n1.6.0.2\n"}]}