Skip to content

Commit 76e671a

Browse files
committed
khash: avoid using kh_exist directly
1 parent c37b069 commit 76e671a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static void cache_evict_entries(git_cache *cache)
127127
while (evict_count > 0) {
128128
khiter_t pos = seed++ % git_oidmap_end(cache->map);
129129

130-
if (kh_exist(cache->map, pos)) {
130+
if (git_oidmap_has_data(cache->map, pos)) {
131131
git_cached_obj *evict = kh_val(cache->map, pos);
132132

133133
evict_count--;

src/oidmap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
3737
#define git_oidmap_valid_index(h, idx) (idx != kh_end(h))
3838

3939
#define git_oidmap_exists(h, k) (kh_get(oid, h, k) != kh_end(h))
40+
#define git_oidmap_has_data(h, idx) kh_exist(h, idx)
4041

4142
#define git_oidmap_value_at(h, idx) kh_val(h, idx)
4243

0 commit comments

Comments
 (0)