From e13ce2ee98fcc9be786d6ce45f71dc929d9fafa7 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 31 Jan 2022 23:36:48 +0200 Subject: [PATCH] lib/encoding: substitute `64-bits.LeadingZeros64()` with `bits.Len64()` --- lib/encoding/nearest_delta.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/encoding/nearest_delta.go b/lib/encoding/nearest_delta.go index 13d78cd09..eb885a9c6 100644 --- a/lib/encoding/nearest_delta.go +++ b/lib/encoding/nearest_delta.go @@ -93,7 +93,7 @@ func nearestDelta(next, prev int64, precisionBits, prevTrailingZeros uint8) (int // There is no need in handling special case origin = -1<<63. } - originBits := 64 - uint8(bits.LeadingZeros64(uint64(origin))) + originBits := uint8(bits.Len64(uint64(origin))) if originBits <= precisionBits { // Cannot zero trailing bits for the given precisionBits. return d, decIfNonZero(prevTrailingZeros) @@ -136,7 +136,7 @@ func getTrailingZeros(v int64, precisionBits uint8) uint8 { v = -v // There is no need in special case handling for v = -1<<63 } - vBits := 64 - uint8(bits.LeadingZeros64(uint64(v))) + vBits := uint8(bits.Len64(uint64(v))) if vBits <= precisionBits { return 0 }