From 241689f7c1284e3ccbd3e835ea869b6d394ce017 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Mon, 5 Feb 2024 16:16:37 -0500 Subject: [PATCH] Remove extra btree alloc --- store/cachekv/store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/cachekv/store.go b/store/cachekv/store.go index cf931dc7afc5..2cb5a63fa6a4 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -104,7 +104,7 @@ func (store *Store) Write() { defer store.mtx.Unlock() if len(store.cache) == 0 && len(store.unsortedCache) == 0 { - store.resetSortedCache() + store.sortedCache = nil return } @@ -145,7 +145,7 @@ func (store *Store) Write() { for key := range store.unsortedCache { delete(store.unsortedCache, key) } - store.resetSortedCache() + store.sortedCache = nil } // CacheWrap implements CacheWrapper.