Skip to content

Commit c5083c7

Browse files
perf(logql): Micro-optimizations for IP filter (#14072)
Co-authored-by: Cyril Tovena <[email protected]>
1 parent 4cd77b9 commit c5083c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/logql/log/ip.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,14 @@ func isHexDigit(r byte) bool {
282282
// It returns the number of chars in the initial segment of `s`
283283
// which consist only of chars from `accept`.
284284
func bytesSpan(s, accept []byte) int {
285-
m := make(map[byte]bool)
285+
var charset [256]bool
286286

287287
for _, r := range accept {
288-
m[r] = true
288+
charset[r] = true
289289
}
290290

291291
for i, r := range s {
292-
if !m[r] {
292+
if !charset[r] {
293293
return i
294294
}
295295
}

0 commit comments

Comments
 (0)