highestByteIndex returns the index (0 to 7) of the highest nonzero byte in v.
(v uint64)
| 388 | |
| 389 | // highestByteIndex returns the index (0 to 7) of the highest nonzero byte in v. |
| 390 | func 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…