mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 21:54:10 -08:00
[PERF] Chunk encoding: simplify writeByte
Rather than append a zero then set the value at that position, append the value. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
b65f1b6560
commit
b9a9689aae
|
@ -95,10 +95,8 @@ func (b *bstream) writeByte(byt byte) {
|
|||
// Complete the last byte with the leftmost b.count bits from byt.
|
||||
b.stream[i] |= byt >> (8 - b.count)
|
||||
|
||||
b.stream = append(b.stream, 0)
|
||||
i++
|
||||
// Write the remainder, if any.
|
||||
b.stream[i] = byt << b.count
|
||||
b.stream = append(b.stream, byt<<b.count)
|
||||
}
|
||||
|
||||
// writeBits writes the nbits right-most bits of u to the stream
|
||||
|
|
Loading…
Reference in a new issue