mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-26 13:11:11 -08:00
Review feedback
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
This commit is contained in:
parent
c8dfba9fa4
commit
01187fbce2
|
@ -322,18 +322,17 @@ func stringMatcherFromRegexp(re *syntax.Regexp) StringMatcher {
|
|||
}
|
||||
// findSetMatches will returns only literals that are case sensitive.
|
||||
matches := findSetMatches(re, "")
|
||||
if left == nil && right == nil {
|
||||
if left == nil && right == nil && len(matches) > 0 {
|
||||
// if there's no any matchers on both side it's a concat of literals
|
||||
if len(matches) > 0 {
|
||||
or := make([]StringMatcher, 0, len(matches))
|
||||
for _, match := range matches {
|
||||
or = append(or, &equalStringMatcher{
|
||||
s: match,
|
||||
caseSensitive: true,
|
||||
})
|
||||
}
|
||||
return orStringMatcher(or)
|
||||
|
||||
or := make([]StringMatcher, 0, len(matches))
|
||||
for _, match := range matches {
|
||||
or = append(or, &equalStringMatcher{
|
||||
s: match,
|
||||
caseSensitive: true,
|
||||
})
|
||||
}
|
||||
return orStringMatcher(or)
|
||||
}
|
||||
// others we found literals in the middle.
|
||||
if len(matches) > 0 {
|
||||
|
|
Loading…
Reference in a new issue