@matheusbsbs / matheus-bagliano / commits / 749bc58c5e
Fork 0

Cleanup in sha1_file.c::cache_or_unpack_entry()

This patch just removes an unnecessary goto which makes the code easier to read and shorter. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Miklos Vajna committed Oct 9, 2008 at 02:11 UTC 749bc58c5eab5b6947d2c01e02d12320005eba99
1 file changed +2 -4
sha1_file.c
+2 -4
@@ -1571,11 +1571,9 @@ static void *cache_or_unpack_entry(struct packed_git *p, off_t base_offset,
1571 struct delta_base_cache_entry *ent = delta_base_cache + hash;
1572
1573 ret = ent->data;
1574 - if (ret && ent->p == p && ent->base_offset == base_offset)
1575 - goto found_cache_entry;
1576 - return unpack_entry(p, base_offset, type, base_size);
1574 + if (!ret || ent->p != p || ent->base_offset != base_offset)
1575 + return unpack_entry(p, base_offset, type, base_size);
1576
1578 -found_cache_entry:
1577 if (!keep_cache) {
1578 ent->data = NULL;
1579 ent->lru.next->prev = ent->lru.prev;