mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
Do lowercase checks in stopwords
This reduces the number of loops we need to do when checking.
This commit is contained in:
1 parent
73387cbc53
commit
93380ad86a
2 files changed
+4
-2
No files matched your search
@@ -89,6 +89,9 @@ func checkShannonEntropy(target string) bool {
|
||||
|
||||
// containsStopWords checks if there are any stop words in target
|
||||
func containsStopWords(target string) bool {
|
||||
// Convert to lowercase to reduce the number of loops needed.
|
||||
target = strings.ToLower(target)
|
||||
|
||||
for _, stopWord := range stopWords {
|
||||
if strings.Contains(target, stopWord) {
|
||||
return true
|
||||
|
||||
Reference in new issue
Block a user