Skip to content

Commit

Permalink
perf(logql): Micro-optimizations for IP filter (#14072)
Browse files Browse the repository at this point in the history
Co-authored-by: Cyril Tovena <[email protected]>
  • Loading branch information
KasonBraley and cyriltovena authored Sep 10, 2024
1 parent 4cd77b9 commit c5083c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/logql/log/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,14 @@ func isHexDigit(r byte) bool {
// It returns the number of chars in the initial segment of `s`
// which consist only of chars from `accept`.
func bytesSpan(s, accept []byte) int {
m := make(map[byte]bool)
var charset [256]bool

for _, r := range accept {
m[r] = true
charset[r] = true
}

for i, r := range s {
if !m[r] {
if !charset[r] {
return i
}
}
Expand Down

0 comments on commit c5083c7

Please sign in to comment.