mirror of
https://github.com/prometheus/prometheus.git
synced 2026-06-03 21:52:13 -04:00
Avoid redundant varint decoding in chunk appender construction
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
d31bb75dc4
commit
ed33aea392
2 changed files with 2 additions and 2 deletions
|
|
@ -154,7 +154,7 @@ func (c *HistogramChunk) Appender() (Appender, error) {
|
|||
leading: it.leading,
|
||||
trailing: it.trailing,
|
||||
}
|
||||
if binary.BigEndian.Uint16(a.b.bytes()) == 0 {
|
||||
if it.numTotal == 0 {
|
||||
a.leading = 0xff
|
||||
}
|
||||
return a, nil
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ func (c *XORChunk) Appender() (Appender, error) {
|
|||
leading: it.leading,
|
||||
trailing: it.trailing,
|
||||
}
|
||||
if binary.BigEndian.Uint16(a.b.bytes()) == 0 {
|
||||
if it.numTotal == 0 {
|
||||
a.leading = 0xff
|
||||
}
|
||||
return a, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue