From 5928875623cd2aa2a79a471c3f4f2e3a9b64b7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Tue, 18 Jul 2023 11:21:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/utils/sets/set_fixed.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/utils/sets/set_fixed.go b/internal/utils/sets/set_fixed.go index 71287b8..7c6d0dc 100644 --- a/internal/utils/sets/set_fixed.go +++ b/internal/utils/sets/set_fixed.go @@ -13,8 +13,8 @@ type FixedSet struct { maxSize int locker sync.RWMutex - m map[interface{}]zero.Zero - keys []interface{} + m map[any]zero.Zero + keys []any } func NewFixedSet(maxSize int) *FixedSet { @@ -23,11 +23,11 @@ func NewFixedSet(maxSize int) *FixedSet { } return &FixedSet{ maxSize: maxSize, - m: map[interface{}]zero.Zero{}, + m: map[any]zero.Zero{}, } } -func (this *FixedSet) Push(item interface{}) { +func (this *FixedSet) Push(item any) { this.locker.Lock() _, ok := this.m[item] if !ok { @@ -44,7 +44,7 @@ func (this *FixedSet) Push(item interface{}) { this.locker.Unlock() } -func (this *FixedSet) Has(item interface{}) bool { +func (this *FixedSet) Has(item any) bool { this.locker.RLock() defer this.locker.RUnlock() @@ -60,7 +60,7 @@ func (this *FixedSet) Size() int { func (this *FixedSet) Reset() { this.locker.Lock() - this.m = map[interface{}]zero.Zero{} + this.m = map[any]zero.Zero{} this.keys = nil this.locker.Unlock() }