From 0995db9ad1af05c763ff80e53b5c2a2d5c33b4fe Mon Sep 17 00:00:00 2001 From: mazrean Date: Sun, 8 Dec 2024 13:06:30 +0900 Subject: [PATCH] update go-tool --- cache/sc.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cache/sc.go b/cache/sc.go index 65f041e..8e49c8b 100644 --- a/cache/sc.go +++ b/cache/sc.go @@ -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 }