More micro-optimizations

This commit is contained in:
Deluan
2024-06-06 07:09:30 -04:00
parent 939f3eee97
commit 0f7d6b5bc4
3 changed files with 19 additions and 25 deletions
+10 -9
View File
@@ -4,16 +4,17 @@ import (
"strings"
)
var utf8ToAscii = strings.NewReplacer(
"", "-",
"", "-",
"“", `"`,
"”", `"`,
"", `'`,
"", `'`,
)
func Clear(name string) string {
r := strings.NewReplacer(
"", "-",
"", "-",
"“", `"`,
"”", `"`,
"", `'`,
"", `'`,
)
return r.Replace(name)
return utf8ToAscii.Replace(name)
}
func LongestCommonPrefix(list []string) string {