Skip to content

Commit

Permalink
Remove extra btree alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon authored and czarcas7ic committed Feb 10, 2024
1 parent cedda88 commit 1e7ee79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions store/cachekv/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 1e7ee79

Please sign in to comment.