diff --git a/tsdb/chunkenc/bstream.go b/tsdb/chunkenc/bstream.go index ad8077c27..c8efeab1d 100644 --- a/tsdb/chunkenc/bstream.go +++ b/tsdb/chunkenc/bstream.go @@ -95,7 +95,7 @@ func (b *bstream) writeByte(byt byte) { } func (b *bstream) writeBits(u uint64, nbits int) { - u <<= (64 - uint(nbits)) + u <<= 64 - uint(nbits) for nbits >= 8 { byt := byte(u >> 56) b.writeByte(byt) diff --git a/tsdb/chunks/head_chunks.go b/tsdb/chunks/head_chunks.go index bc6915c80..1443e0bd4 100644 --- a/tsdb/chunks/head_chunks.go +++ b/tsdb/chunks/head_chunks.go @@ -386,7 +386,7 @@ func (cdm *ChunkDiskMapper) cut() (returnErr error) { cdm.readPathMtx.Unlock() } - mmapFile, err := fileutil.OpenMmapFileWithSize(newFile.Name(), int(MaxHeadChunkFileSize)) + mmapFile, err := fileutil.OpenMmapFileWithSize(newFile.Name(), MaxHeadChunkFileSize) if err != nil { return err }