summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2017-01-25 14:05:24 +0100
committerPatrick Steinhardt <ps@pks.im>2017-02-17 11:41:06 +0100
commit63e914cbf4e6cb07d39b5a6f31749f78247ff594 (patch)
tree3556c9b0723929a4ebd3084596a56943813b3b08 /src/cache.c
parenta1b23df58cb704a1ac3e0670a26c804d8a08ed2e (diff)
downloadlibgit2-63e914cbf4e6cb07d39b5a6f31749f78247ff594.tar.gz
khash: avoid using `kh_size` directly
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cache.c b/src/cache.c
index 16ae9b397..e8fd207b1 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -47,11 +47,11 @@ void git_cache_dump_stats(git_cache *cache)
{
git_cached_obj *object;
- if (kh_size(cache->map) == 0)
+ if (git_cache_size(cache) == 0)
return;
- printf("Cache %p: %d items cached, %"PRIdZ" bytes\n",
- cache, kh_size(cache->map), cache->used_memory);
+ printf("Cache %p: %"PRIuZ" items cached, %"PRIdZ" bytes\n",
+ cache, git_cache_size(cache), cache->used_memory);
kh_foreach_value(cache->map, object, {
char oid_str[9];
@@ -81,7 +81,7 @@ static void clear_cache(git_cache *cache)
{
git_cached_obj *evict = NULL;
- if (kh_size(cache->map) == 0)
+ if (git_cache_size(cache) == 0)
return;
kh_foreach_value(cache->map, evict, {
@@ -119,7 +119,7 @@ static void cache_evict_entries(git_cache *cache)
ssize_t evicted_memory = 0;
/* do not infinite loop if there's not enough entries to evict */
- if (evict_count > kh_size(cache->map)) {
+ if (evict_count > git_cache_size(cache)) {
clear_cache(cache);
return;
}