MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / highestByteIndex

Function highestByteIndex

pkg/util/encoding/encoding.go:496–510  ·  view source on GitHub ↗

highestByteIndex returns the index (0 to 7) of the highest nonzero byte in v.

(v uint64)

Source from the content-addressed store, hash-verified

494
495// highestByteIndex returns the index (0 to 7) of the highest nonzero byte in v.
496func highestByteIndex(v uint64) int {
497 l := 0
498 if v > 0xffffffff {
499 v >>= 32
500 l += 4
501 }
502 if v > 0xffff {
503 v >>= 16
504 l += 2
505 }
506 if v > 0xff {
507 l++
508 }
509 return l
510}
511
512// EncLenUvarintAscending returns the encoding length for EncodeUvarintAscending
513// without actually encoding.

Callers 2

EncLenUvarintAscendingFunction · 0.85
EncLenUvarintDescendingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…