Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mazrean committed Dec 8, 2024
1 parent 0995db9 commit 2ee81ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cache/sc.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ func (m *AtomicMap[K, V, T]) Update(key K, f func(V) (V, bool)) {
defer m.locker.Unlock()
av, ok := m.m[key]
if !ok {
return
av = &atomic.Pointer[T]{}
m.m[key] = av
}

v, ok := f(av.Load())
Expand Down

0 comments on commit 2ee81ad

Please sign in to comment.