mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-31 15:06:26 +00:00
wip
This commit is contained in:
parent
ac846f057a
commit
93c0cffda6
1 changed files with 5 additions and 3 deletions
|
@ -361,9 +361,11 @@ func marshalVarUint64sSlow(dst []byte, us []uint64) []byte {
|
||||||
// UnmarshalVarUint64 returns unmarshaled uint64 from src and returns
|
// UnmarshalVarUint64 returns unmarshaled uint64 from src and returns
|
||||||
// the remaining tail from src.
|
// the remaining tail from src.
|
||||||
func UnmarshalVarUint64(src []byte) ([]byte, uint64, error) {
|
func UnmarshalVarUint64(src []byte) ([]byte, uint64, error) {
|
||||||
var tmp [1]uint64
|
u64, offset := binary.Uvarint(src)
|
||||||
tail, err := UnmarshalVarUint64s(tmp[:], src)
|
if offset <= 0 {
|
||||||
return tail, tmp[0], err
|
return src, 0, fmt.Errorf("cannot read varuint64")
|
||||||
|
}
|
||||||
|
return src[offset:], u64, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalVarUint64s unmarshals len(dst) uint64 values from src to dst
|
// UnmarshalVarUint64s unmarshals len(dst) uint64 values from src to dst
|
||||||
|
|
Loading…
Reference in a new issue