diff options
author | guangwu <guoguangwu@magic-shield.com> | 2023-06-17 18:10:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-17 19:10:12 +0900 |
commit | 4772bd8d4c724b6cd4c58a42377008410264322b (patch) | |
tree | 5cfdef39b711afb177914b160f25a64c0355da94 /src/algo | |
parent | d471067e3f46f64e6401d1c5717424535fe4c96c (diff) |
Use strings.ContainsRune instead (#3335)
Diffstat (limited to 'src/algo')
-rw-r--r-- | src/algo/algo.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/algo/algo.go b/src/algo/algo.go index ba09dc50..1d021ed0 100644 --- a/src/algo/algo.go +++ b/src/algo/algo.go @@ -221,9 +221,9 @@ func charClassOfAscii(char rune) charClass { return charUpper } else if char >= '0' && char <= '9' { return charNumber - } else if strings.IndexRune(whiteChars, char) >= 0 { + } else if strings.ContainsRune(whiteChars, char) { return charWhite - } else if strings.IndexRune(delimiterChars, char) >= 0 { + } else if strings.ContainsRune(delimiterChars, char) { return charDelimiter } return charNonWord @@ -240,7 +240,7 @@ func charClassOfNonAscii(char rune) charClass { return charLetter } else if unicode.IsSpace(char) { return charWhite - } else if strings.IndexRune(delimiterChars, char) >= 0 { + } else if strings.ContainsRune(delimiterChars, char) { return charDelimiter } return charNonWord |