symbolCacheEntry field type alignment, thus saving 8 bytes.

Signed-off-by: songjiayang <songjiayang1@gmail.com>
This commit is contained in:
songjiayang 2023-11-09 00:42:50 +08:00
parent ab2a7bb74f
commit 443867f1aa
1 changed files with 2 additions and 2 deletions

View File

@ -107,8 +107,8 @@ func newCRC32() hash.Hash32 {
type symbolCacheEntry struct { type symbolCacheEntry struct {
index uint32 index uint32
lastValue string
lastValueIndex uint32 lastValueIndex uint32
lastValue string
} }
// Writer implements the IndexWriter interface for the standard // Writer implements the IndexWriter interface for the standard
@ -457,8 +457,8 @@ func (w *Writer) AddSeries(ref storage.SeriesRef, lset labels.Labels, chunks ...
} }
w.symbolCache[l.Name] = symbolCacheEntry{ w.symbolCache[l.Name] = symbolCacheEntry{
index: nameIndex, index: nameIndex,
lastValue: l.Value,
lastValueIndex: valueIndex, lastValueIndex: valueIndex,
lastValue: l.Value,
} }
} }
w.buf2.PutUvarint32(valueIndex) w.buf2.PutUvarint32(valueIndex)