mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fix: comments
Signed-off-by: Manik Rana <manikrana54@gmail.com>
This commit is contained in:
parent
8ea8352fdc
commit
9c4bc807be
|
@ -31,16 +31,19 @@ func (ls Labels) Len() int { return len(ls) }
|
|||
func (ls Labels) Swap(i, j int) { ls[i], ls[j] = ls[j], ls[i] }
|
||||
func (ls Labels) Less(i, j int) bool { return ls[i].Name < ls[j].Name }
|
||||
|
||||
func (l Labels) ExtractNames() []string {
|
||||
names := make([]string, len(l))
|
||||
for i, label := range l {
|
||||
|
||||
// ExtractNames returns an array of all Name in ls.
|
||||
func (ls Labels) ExtractNames() []string {
|
||||
names := make([]string, len(ls))
|
||||
for i, label := range ls {
|
||||
names[i] = label.Name
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
||||
func (l Labels) Contains(name string) bool {
|
||||
for _, label := range l {
|
||||
// Contains returns true if the label set contains the provided label name.
|
||||
func (ls Labels) Contains(name string) bool {
|
||||
for _, label := range ls {
|
||||
if label.Name == name {
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -282,7 +282,7 @@ loop:
|
|||
}
|
||||
|
||||
// We need this because we want offsets of the original parser unchanged when
|
||||
// we're working with a new parser in CreatedTimeStamp()
|
||||
// we're working with a new parser in CreatedTimeStamp().
|
||||
func deepCopyParser(p *OpenMetricsParser) OpenMetricsParser {
|
||||
newB := make([]byte, len(p.l.b))
|
||||
copy(newB, p.l.b)
|
||||
|
|
Loading…
Reference in a new issue