mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01:00
lib/encoding: substitute 64-bits.LeadingZeros64()
with bits.Len64()
This commit is contained in:
parent
a8509c112a
commit
e13ce2ee98
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user