refactor(config): use non-capture groups for allowlists (#1735)

Non-capture groups appear to be measurably faster.
This commit is contained in:
Richard Gomez authored and GitHub committed 2025-01-28 19:54:20 -06:00
1 parent 36c52c6b73
commit 7fc11bb264
7 files changed
+209 -177

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@ func KubernetesSecret() *config.Rule {
// Avoid overreach between directives.
RegexTarget: "match",
Regexes: []*regexp.Regexp{
regexp.MustCompile(`(kind:(.|\s)+\n---\n(.|\s)+\bdata:|data:(.|\s)+\n---\n(.|\s)+\bkind:)`),
regexp.MustCompile(`(kind:(?:.|\s)+\n---\n(?:.|\s)+\bdata:|data:(?:.|\s)+\n---\n(?:.|\s)+\bkind:)`),
},
},
},