cache: remove unused function cache_invalidate

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-02-16 00:42:22 +00:00
parent a93bbc30e5
commit 96de4f07ca
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
2 changed files with 0 additions and 12 deletions

View File

@ -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) {

View File

@ -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);