Work around compiler bug

Benchmarks don't show any significant changes.
This commit is contained in:
beorn7 2016-03-29 16:59:37 +02:00
parent 24a3ad3d16
commit d09ca03e10
1 changed files with 6 additions and 1 deletions

View File

@ -759,7 +759,12 @@ func (c varbitChunk) addZeroBit(offset uint16) uint16 {
// Just increase the offset.
return offset + 1
}
c[offset/8] &^= bitMask[1][offset%8]
newByte := c[offset/8] &^ bitMask[1][offset%8]
c[offset/8] = newByte
// TODO(beorn7): The two lines above could be written as
// c[offset/8] &^= bitMask[1][offset%8]
// However, that tickles a compiler bug with GOARCH=386.
// See https://github.com/prometheus/prometheus/issues/1509
return offset + 1
}