summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-01-25 14:32:23 +0100
committerPatrick Steinhardt <ps@pks.im>2017-02-17 11:41:06 +0100
commit71a54317efc465c0ccba8fd8d588d03087433048 (patch)
treef54d2131aaca7af6433d092ce38f7a4ce783b2c4 /src/cache.c
parentcb18386f72f07fc7316a0be892b98185d4aef7ce (diff)
downloadlibgit2-71a54317efc465c0ccba8fd8d588d03087433048.tar.gz
khash: avoid using `kh_key` directly
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cache.c b/src/cache.c
index c5f576a80..89c46ef7d 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -199,10 +199,8 @@ static void *cache_store(git_cache *cache, git_cached_obj *entry)
if (!git_oidmap_valid_index(cache->map, pos)) {
int rval;
- pos = kh_put(oid, cache->map, &entry->oid, &rval);
+ git_oidmap_insert(cache->map, &entry->oid, entry, rval);
if (rval >= 0) {
- kh_key(cache->map, pos) = &entry->oid;
- git_oidmap_value_at(cache->map, pos) = entry;
git_cached_obj_incref(entry);
cache->used_memory += entry->size;
git_atomic_ssize_add(&git_cache__current_storage, (ssize_t)entry->size);
@@ -221,7 +219,7 @@ static void *cache_store(git_cache *cache, git_cached_obj *entry)
git_cached_obj_decref(stored_entry);
git_cached_obj_incref(entry);
- kh_key(cache->map, pos) = &entry->oid;
+ git_oidmap_key(cache->map, pos) = &entry->oid;
git_oidmap_value_at(cache->map, pos) = entry;
} else {
/* NO OP */