From 0fed73aa05299c4a249927d522e28da4b7295ae8 Mon Sep 17 00:00:00 2001 From: tegk Date: Thu, 17 Oct 2019 12:50:33 +0100 Subject: [PATCH] unnecessary type conversion --- policy.go | 2 +- sketch.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/policy.go b/policy.go index 4845174d..68b0fd7f 100644 --- a/policy.go +++ b/policy.go @@ -197,7 +197,7 @@ func (p *defaultPolicy) Del(key uint64) { func (p *defaultPolicy) Cap() int64 { p.Lock() - capacity := int64(p.evict.maxCost - p.evict.used) + capacity := p.evict.maxCost - p.evict.used p.Unlock() return capacity } diff --git a/sketch.go b/sketch.go index c2b8c0f4..7c7a9a2d 100644 --- a/sketch.go +++ b/sketch.go @@ -102,7 +102,7 @@ func newCmRow(numCounters int64) cmRow { } func (r cmRow) get(n uint64) byte { - return byte(r[n/2]>>((n&1)*4)) & 0x0f + return r[n/2]>>((n&1)*4) & 0x0f } func (r cmRow) increment(n uint64) {