This commit is contained in:
Aliaksandr Valialkin 2024-04-29 07:45:44 +02:00
parent a62b0ab12b
commit a2878feb1e
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB
2 changed files with 11 additions and 12 deletions

View file

@ -4,7 +4,6 @@ import (
"math"
"strconv"
"sync"
"unicode/utf8"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/encoding"
@ -67,17 +66,6 @@ func (fs *streamFilter) apply(bs *blockSearch, bm *bitmap) {
}
}
func getTokensSkipLast(s string) []string {
for {
r, runeSize := utf8.DecodeLastRuneInString(s)
if !isTokenRune(r) {
break
}
s = s[:len(s)-runeSize]
}
return tokenizeStrings(nil, []string{s})
}
func toUint64Range(minValue, maxValue float64) (uint64, uint64) {
minValue = math.Ceil(minValue)
maxValue = math.Floor(maxValue)

View file

@ -303,3 +303,14 @@ func matchPrefix(s, prefix string) bool {
return true
}
}
func getTokensSkipLast(s string) []string {
for {
r, runeSize := utf8.DecodeLastRuneInString(s)
if !isTokenRune(r) {
break
}
s = s[:len(s)-runeSize]
}
return tokenizeStrings(nil, []string{s})
}