修复ttlcache/Cache.IncreaseInt64返回结果的Bug

This commit is contained in:
刘祥超
2021-03-26 11:47:02 +08:00
parent 6b6b08c53d
commit 4fd42c6d2f

View File

@@ -31,7 +31,7 @@ func (this *Piece) IncreaseInt64(key uint64, delta int64, expiredAt int64) (resu
this.locker.Lock() this.locker.Lock()
item, ok := this.m[key] item, ok := this.m[key]
if ok { if ok {
result := types.Int64(item.Value) + delta result = types.Int64(item.Value) + delta
item.Value = result item.Value = result
item.expiredAt = expiredAt item.expiredAt = expiredAt
} else { } else {