From a2878feb1e22a89f54c9ec57b89f5ec5d3e32ebd Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 29 Apr 2024 07:45:44 +0200 Subject: [PATCH] wip --- lib/logstorage/filter.go | 12 ------------ lib/logstorage/filter_prefix.go | 11 +++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/logstorage/filter.go b/lib/logstorage/filter.go index 950223b75..de5a4e984 100644 --- a/lib/logstorage/filter.go +++ b/lib/logstorage/filter.go @@ -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) diff --git a/lib/logstorage/filter_prefix.go b/lib/logstorage/filter_prefix.go index 50a819501..9a9693c29 100644 --- a/lib/logstorage/filter_prefix.go +++ b/lib/logstorage/filter_prefix.go @@ -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}) +}