Skip to content

Commit

Permalink
fixup! Reuse query iterator
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandros Filios <[email protected]>
  • Loading branch information
alexandrosfilios committed Feb 14, 2025
1 parent d6e88c7 commit 2ef7789
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions platform/common/utils/cache/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ package cache
// NewMapCache creates a dummy implementation of the Cache interface.
// It is backed by a map with unlimited capacity.
func NewMapCache[K comparable, V any]() *mapCache[K, V] {
return &mapCache[K, V]{
m: map[K]V{},
l: &noLock{},
}
return NewMapCacheWithLock[K, V](&noLock{})
}

func NewMapCacheWithLock[K comparable, V any](l rwLock) *mapCache[K, V] {
return &mapCache[K, V]{m: map[K]V{}, l: l}
}

type mapCache[K comparable, V any] struct {
Expand Down

0 comments on commit 2ef7789

Please sign in to comment.