Skip to content

Commit

Permalink
consolidate to lower
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav committed Jan 31, 2024
1 parent 6a59c69 commit a93a8fd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/engine/ahocorasick/ahocorasickcore.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ func NewAhoCorasickCore(allDetectors []detectors.Detector) *AhoCorasickCore {
// provided input. This method populates an existing map rather than allocating a new one because
// it will be called once per chunk and that many allocations has a noticeable performance cost.
func (ac *AhoCorasickCore) PopulateMatchingDetectors(chunkData string, dts map[DetectorKey]detectors.Detector) []detectors.Detector {
lowerChunkData := strings.ToLower(chunkData)
matches := ac.prefilter.MatchString(lowerChunkData)
matches := ac.prefilter.MatchString(strings.ToLower(chunkData))

// Use a map to avoid adding duplicate detectors to the slice.
addedDetectors := make(map[DetectorKey]struct{})
Expand Down

0 comments on commit a93a8fd

Please sign in to comment.