More micro-optimizations
This commit is contained in:
+10
-9
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user