summaryrefslogtreecommitdiff
path: root/src/pack.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-01-25 14:14:12 +0100
committerPatrick Steinhardt <ps@pks.im>2017-02-17 11:41:06 +0100
commit64e46dc3b54bb7071b5d21e16db8ebf5a44eb8ed (patch)
tree14ed6189acd384bb3b7f8ae77fd9178a98d86aec /src/pack.c
parent036daa59e94bbe1a14ccd8fa018618393a0c62fb (diff)
downloadlibgit2-64e46dc3b54bb7071b5d21e16db8ebf5a44eb8ed.tar.gz
khash: avoid using `kh_end` directly
Diffstat (limited to 'src/pack.c')
-rw-r--r--src/pack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pack.c b/src/pack.c
index 8a204342d..e23d50110 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -118,7 +118,7 @@ static git_pack_cache_entry *cache_get(git_pack_cache *cache, git_off_t offset)
return NULL;
k = kh_get(off, cache->entries, offset);
- if (k != kh_end(cache->entries)) { /* found it */
+ if (git_offmap_valid_index(cache->entries, k)) { /* found it */
entry = kh_value(cache->entries, k);
git_atomic_inc(&entry->refcount);
entry->last_usage = cache->use_ctr++;
@@ -957,7 +957,7 @@ git_off_t get_delta_base(
git_oid_fromraw(&oid, base_info);
k = kh_get(oid, p->idx_cache, &oid);
- if (k != kh_end(p->idx_cache)) {
+ if (git_oidmap_valid_index(p->idx_cache, k)) {
*curpos += 20;
return ((struct git_pack_entry *)kh_value(p->idx_cache, k))->offset;
} else {