From 4fd42c6d2ffa9f3a56e2f90bb35ca22f288ffa11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 26 Mar 2021 11:47:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dttlcache/Cache.IncreaseInt64?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/ttlcache/piece.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ttlcache/piece.go b/internal/ttlcache/piece.go index c1f8782..4c0da96 100644 --- a/internal/ttlcache/piece.go +++ b/internal/ttlcache/piece.go @@ -31,7 +31,7 @@ func (this *Piece) IncreaseInt64(key uint64, delta int64, expiredAt int64) (resu this.locker.Lock() item, ok := this.m[key] if ok { - result := types.Int64(item.Value) + delta + result = types.Int64(item.Value) + delta item.Value = result item.expiredAt = expiredAt } else {