From 655087fa4290f46068f9f186364480b7d4e913f3 Mon Sep 17 00:00:00 2001 From: acute_interpreter_panic <223899499+acute-interpreter-panic@users.noreply.github.com> Date: Fri, 10 Oct 2025 01:11:03 +0200 Subject: [PATCH] performance --- internal/common/strings.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/common/strings.go b/internal/common/strings.go index a16b780..9fd7ae9 100644 --- a/internal/common/strings.go +++ b/internal/common/strings.go @@ -1,7 +1,6 @@ package common import ( - "regexp" "strconv" "strings" ) @@ -23,10 +22,13 @@ func ZeroPad(num int, length int) string { return strings.Repeat("0", length-len(str)) + str } -var numericRegex = regexp.MustCompile(`^[\d]+$`) - func IsNumeric(num string) bool { - return numericRegex.MatchString(num) + for _, c := range num { + if c >= '0' && c <= '9' { + return false + } + } + return true } func CleanSongTitle(title string, artistName string) string {