Skip to content

Commit

Permalink
Cleanup in sha1_file.c::cache_or_unpack_entry()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miklos Vajna authored and Shawn O. Pearce committed Oct 9, 2008
1 parent c4f6a48 commit 749bc58
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,11 +1571,9 @@ static void *cache_or_unpack_entry(struct packed_git *p, off_t base_offset,
struct delta_base_cache_entry *ent = delta_base_cache + hash;

ret = ent->data;
if (ret && ent->p == p && ent->base_offset == base_offset)
goto found_cache_entry;
return unpack_entry(p, base_offset, type, base_size);
if (!ret || ent->p != p || ent->base_offset != base_offset)
return unpack_entry(p, base_offset, type, base_size);

found_cache_entry:
if (!keep_cache) {
ent->data = NULL;
ent->lru.next->prev = ent->lru.prev;
Expand Down

0 comments on commit 749bc58

Please sign in to comment.