summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-10-09 00:11:24 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-10-09 15:55:42 (GMT)
commit749bc58c5eab5b6947d2c01e02d12320005eba99 (patch)
treea0bf1cc9154c0d5833ff289a8f2dbb08f88c2639 /sha1_file.c
parentc4f6a48969b33e7fec8fce592e38a60849782d2a (diff)
downloadgit-749bc58c5eab5b6947d2c01e02d12320005eba99.zip
git-749bc58c5eab5b6947d2c01e02d12320005eba99.tar.gz
git-749bc58c5eab5b6947d2c01e02d12320005eba99.tar.bz2
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>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 7515987..ea6bd99 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -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;