mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
16 lines
389 B
Go
16 lines
389 B
Go
|
//go:build stringlabels
|
||
|
|
||
|
// Split out function which needs to be coded differently for stringlabels case.
|
||
|
|
||
|
package tsdb
|
||
|
|
||
|
import "strings"
|
||
|
|
||
|
func (sw *symbolsBatcher) addSymbol(sym string) error {
|
||
|
if _, found := sw.buffer[sym]; !found {
|
||
|
sym = strings.Clone(sym) // So we don't retain reference to the entire labels block.
|
||
|
sw.buffer[sym] = struct{}{}
|
||
|
}
|
||
|
return sw.flushSymbols(false)
|
||
|
}
|