mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
wip
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
This commit is contained in:
parent
0bb2d1954b
commit
17a558336b
|
@ -243,7 +243,12 @@ func optimizeConcatRegex(r *syntax.Regexp) (prefix, suffix, contains string) {
|
|||
}
|
||||
|
||||
// todo remove anchors ^foo$
|
||||
// .*POD.*
|
||||
// remove captures.
|
||||
// .+ | .* | .*POD.* | 5.. | test-.* | .*-test | test-.+ | .+-test
|
||||
|
||||
// regexp prefix fn ???? can we use this ?
|
||||
|
||||
// benchmark them
|
||||
|
||||
func contains(s, substr string) bool {
|
||||
pos := strings.Index(s, substr)
|
||||
|
@ -254,6 +259,7 @@ func contains(s, substr string) bool {
|
|||
}
|
||||
|
||||
func matchesAnyZeroOrMoreNotNL(s string) bool {
|
||||
// strings.Contains(s string, substr string) faster ??
|
||||
for _, r := range s {
|
||||
if r == '\n' {
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue