khash: avoid using kh_exist directly

This commit is contained in:
Patrick Steinhardt 2017-01-25 14:20:56 +01:00
parent c37b069b9f
commit 76e671a653
2 changed files with 2 additions and 1 deletions

View File

@ -127,7 +127,7 @@ static void cache_evict_entries(git_cache *cache)
while (evict_count > 0) {
khiter_t pos = seed++ % git_oidmap_end(cache->map);
if (kh_exist(cache->map, pos)) {
if (git_oidmap_has_data(cache->map, pos)) {
git_cached_obj *evict = kh_val(cache->map, pos);
evict_count--;

View File

@ -37,6 +37,7 @@ GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
#define git_oidmap_valid_index(h, idx) (idx != kh_end(h))
#define git_oidmap_exists(h, k) (kh_get(oid, h, k) != kh_end(h))
#define git_oidmap_has_data(h, idx) kh_exist(h, idx)
#define git_oidmap_value_at(h, idx) kh_val(h, idx)