Skip to content

Commit

Permalink
remove size when initializing map
Browse files Browse the repository at this point in the history
  • Loading branch information
hongkuancn authored and swithek committed Aug 24, 2024
1 parent f4a6991 commit 1e6fd11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ func (c *Cache[K, V]) Items() map[K]*Item[K, V] {
c.items.mu.RLock()
defer c.items.mu.RUnlock()

items := make(map[K]*Item[K, V], len(c.items.values))
items := make(map[K]*Item[K, V])
for k, elem := range c.items.values {
item := elem.Value.(*Item[K, V])
if item != nil && !item.isExpiredUnsafe() {
Expand Down

0 comments on commit 1e6fd11

Please sign in to comment.