tlv: fix comments for numLeadingZeroBytes{32,64} funcs
This commit is contained in:
parent
2c979fc179
commit
890bcb2ade
@ -67,7 +67,7 @@ func DTUint16(r io.Reader, val interface{}, buf *[8]byte, l uint64) error {
|
|||||||
return NewTypeForDecodingErr(val, "uint16", l, 2)
|
return NewTypeForDecodingErr(val, "uint16", l, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// numLeadingZeroBytes16 computes the number of leading zeros for a uint32.
|
// numLeadingZeroBytes32 computes the number of leading zeros for a uint32.
|
||||||
func numLeadingZeroBytes32(v uint32) uint64 {
|
func numLeadingZeroBytes32(v uint32) uint64 {
|
||||||
switch {
|
switch {
|
||||||
case v == 0:
|
case v == 0:
|
||||||
@ -128,7 +128,7 @@ func DTUint32(r io.Reader, val interface{}, buf *[8]byte, l uint64) error {
|
|||||||
return NewTypeForDecodingErr(val, "uint32", l, 4)
|
return NewTypeForDecodingErr(val, "uint32", l, 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
// numLeadingZeroBytes64 computes the number of leading zeros for a uint32.
|
// numLeadingZeroBytes64 computes the number of leading zeros for a uint64.
|
||||||
//
|
//
|
||||||
// TODO(conner): optimize using unrolled binary search
|
// TODO(conner): optimize using unrolled binary search
|
||||||
func numLeadingZeroBytes64(v uint64) uint64 {
|
func numLeadingZeroBytes64(v uint64) uint64 {
|
||||||
|
Loading…
Reference in New Issue
Block a user