Skip to content

Commit

Permalink
update go-tool
Browse files Browse the repository at this point in the history
  • Loading branch information
mazrean committed Dec 8, 2024
1 parent 84b6c57 commit 0995db9
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cache/sc.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,14 +409,7 @@ func (m *AtomicMap[K, V, T]) Len() int {
func (m *AtomicMap[K, V, T]) Update(key K, f func(V) (V, bool)) {
m.locker.Lock()
defer m.locker.Unlock()
av, ok := func() (*atomic.Pointer[T], bool) {
m.locker.RLock()
defer m.locker.RUnlock()

v, ok := m.m[key]

return v, ok
}()
av, ok := m.m[key]
if !ok {
return
}
Expand Down

0 comments on commit 0995db9

Please sign in to comment.