mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-27 14:39:40 -08:00
Use VarbitUint rather than VarbitInt to encode len(spans)
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
3179215a59
commit
d31bb75dc4
|
@ -56,7 +56,7 @@ func readHistogramChunkLayout(b *bstreamReader) (
|
||||||
}
|
}
|
||||||
|
|
||||||
func putHistogramChunkLayoutSpans(b *bstream, spans []histogram.Span) {
|
func putHistogramChunkLayoutSpans(b *bstream, spans []histogram.Span) {
|
||||||
putVarbitInt(b, int64(len(spans)))
|
putVarbitUint(b, uint64(len(spans)))
|
||||||
for _, s := range spans {
|
for _, s := range spans {
|
||||||
putVarbitUint(b, uint64(s.Length))
|
putVarbitUint(b, uint64(s.Length))
|
||||||
putVarbitInt(b, int64(s.Offset))
|
putVarbitInt(b, int64(s.Offset))
|
||||||
|
@ -65,7 +65,7 @@ func putHistogramChunkLayoutSpans(b *bstream, spans []histogram.Span) {
|
||||||
|
|
||||||
func readHistogramChunkLayoutSpans(b *bstreamReader) ([]histogram.Span, error) {
|
func readHistogramChunkLayoutSpans(b *bstreamReader) ([]histogram.Span, error) {
|
||||||
var spans []histogram.Span
|
var spans []histogram.Span
|
||||||
num, err := readVarbitInt(b)
|
num, err := readVarbitUint(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue