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) 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 (ls Labels) Less(i, j int) bool { return ls[i].Name < ls[j].Name }
|
||||||
|
|
||||||
func (l Labels) ExtractNames() []string {
|
|
||||||
names := make([]string, len(l))
|
// ExtractNames returns an array of all Name in ls.
|
||||||
for i, label := range l {
|
func (ls Labels) ExtractNames() []string {
|
||||||
|
names := make([]string, len(ls))
|
||||||
|
for i, label := range ls {
|
||||||
names[i] = label.Name
|
names[i] = label.Name
|
||||||
}
|
}
|
||||||
return names
|
return names
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l Labels) Contains(name string) bool {
|
// Contains returns true if the label set contains the provided label name.
|
||||||
for _, label := range l {
|
func (ls Labels) Contains(name string) bool {
|
||||||
|
for _, label := range ls {
|
||||||
if label.Name == name {
|
if label.Name == name {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -282,7 +282,7 @@ loop:
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need this because we want offsets of the original parser unchanged when
|
// 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 {
|
func deepCopyParser(p *OpenMetricsParser) OpenMetricsParser {
|
||||||
newB := make([]byte, len(p.l.b))
|
newB := make([]byte, len(p.l.b))
|
||||||
copy(newB, p.l.b)
|
copy(newB, p.l.b)
|
||||||
|
|
Loading…
Reference in a new issue