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