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

Function highestByteIndex

pkg/util/encoding/encoding.go:390–404  ·  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

388
389// highestByteIndex returns the index (0 to 7) of the highest nonzero byte in v.
390func highestByteIndex(v uint64) int {
391 l := 0
392 if v > 0xffffffff {
393 v >>= 32
394 l += 4
395 }
396 if v > 0xffff {
397 v >>= 16
398 l += 2
399 }
400 if v > 0xff {
401 l++
402 }
403 return l
404}
405
406// EncLenUvarintAscending returns the encoding length for EncodeUvarintAscending
407// 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…