From 96de4f07ca1cb3c21293fbce9e25c1a5129a4159 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Fri, 16 Feb 2024 00:42:22 +0000 Subject: [PATCH] cache: remove unused function cache_invalidate Signed-off-by: Yuxuan Shui --- src/cache.c | 9 --------- src/cache.h | 3 --- 2 files changed, 12 deletions(-) diff --git a/src/cache.c b/src/cache.c index e297c4fe..e4f2927f 100644 --- a/src/cache.c +++ b/src/cache.c @@ -35,15 +35,6 @@ cache_invalidate_impl(struct cache *c, struct cache_handle *e, cache_free_t free } } -void cache_invalidate(struct cache *c, const char *key, cache_free_t free_fn) { - struct cache_handle *e; - HASH_FIND_STR(c->entries, key, e); - - if (e) { - cache_invalidate_impl(c, e, free_fn); - } -} - void cache_invalidate_all(struct cache *c, cache_free_t free_fn) { struct cache_handle *e, *tmpe; HASH_ITER(hh, c->entries, e, tmpe) { diff --git a/src/cache.h b/src/cache.h index a50ec4bc..8c022cf4 100644 --- a/src/cache.h +++ b/src/cache.h @@ -38,9 +38,6 @@ int cache_get_or_fetch(struct cache *, const char *key, struct cache_handle **va /// returned. struct cache_handle *cache_get(struct cache *, const char *key); -/// Invalidate a value in the cache. -void cache_invalidate(struct cache *, const char *key, cache_free_t free_fn); - /// Invalidate all values in the cache. After this call, `struct cache` holds no allocated /// memory, and can be discarded. void cache_invalidate_all(struct cache *, cache_free_t free_fn);