Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
Fixed race exception on SanitizeKey
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsAreku committed May 22, 2018
1 parent 6a361b8 commit 5cbea23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ var secondRegex = regexp.MustCompile(`(?P<Val>[0-9]+(?:\.[0-9]+)?) seconds?`)
var percentRegex = regexp.MustCompile(`(?P<Val>[0-9]{1,3})\s?%`)
var pluralizerRegex = regexp.MustCompile(`(?P<Start>_|[^a-z]|^)(?P<Term>blow|boost|kill|assist|barrier|hit|multikill|elimination)(?P<End>$|[^a-z])`)

var t = transform.Chain(norm.NFD, runes.Remove(runes.In(unicode.Mn)), norm.NFC)

func SanitizeKey(text string) string {
var t = transform.Chain(norm.NFD, runes.Remove(runes.In(unicode.Mn)), norm.NFC)

text = strings.ToLower(text)
text, _, _ = transform.String(t, text)
text = spaceRegex.ReplaceAllString(text, "_")
Expand Down

0 comments on commit 5cbea23

Please sign in to comment.