From 355c5b7700960608534f1e6fa319a2cfc0f59c81 Mon Sep 17 00:00:00 2001 From: team-humaki Date: Fri, 11 Sep 2026 22:14:34 -0700 Subject: [PATCH] fix: use strings.IndexByte in extractKeyValue Avoid copying the line to []byte just to find '='. --- internal/secretscanner/secretscanner.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/secretscanner/secretscanner.go b/internal/secretscanner/secretscanner.go index c70b177..695a86d 100644 --- a/internal/secretscanner/secretscanner.go +++ b/internal/secretscanner/secretscanner.go @@ -6,6 +6,7 @@ import ( "math" "path/filepath" "regexp" + "strings" ) // Method identifies which detection technique produced a Match. @@ -180,7 +181,7 @@ func (s *Scanner) Scan(content []byte) ([]Match, error) { // extractKeyValue splits a "KEY=VALUE" line into its key and value, if present. func extractKeyValue(line string) (key string, value string, ok bool) { - idx := bytes.IndexByte([]byte(line), '=') + idx := strings.IndexByte(line, '=') if idx < 0 { return "", "", false }