fix: atomic.TypedValue panic

This commit is contained in:
wwqgtxx 2024-03-29 14:43:42 +08:00
parent 4542fc0991
commit 72d0948224

View File

@ -43,7 +43,7 @@ func (t *TypedValue[T]) Swap(new T) T {
if old == nil {
return DefaultValue[T]()
}
return old.(T)
return old.(tValue[T]).value
}
func (t *TypedValue[T]) CompareAndSwap(old, new T) bool {