performance

This commit is contained in:
acute_interpreter_panic
2025-10-10 01:11:03 +02:00
parent 19185f38a3
commit 655087fa42

View File

@@ -1,7 +1,6 @@
package common package common
import ( import (
"regexp"
"strconv" "strconv"
"strings" "strings"
) )
@@ -23,10 +22,13 @@ func ZeroPad(num int, length int) string {
return strings.Repeat("0", length-len(str)) + str return strings.Repeat("0", length-len(str)) + str
} }
var numericRegex = regexp.MustCompile(`^[\d]+$`)
func IsNumeric(num string) bool { 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 { func CleanSongTitle(title string, artistName string) string {