summaryrefslogtreecommitdiff
path: root/src/pattern.go
diff options
context:
space:
mode:
authorZhizhen He <hezhizhen.yi@gmail.com>2024-05-18 16:06:33 +0800
committerGitHub <noreply@github.com>2024-05-18 17:06:33 +0900
commit01e7668915c4e3cf8c9eeca283d41beac924fe1f (patch)
tree721306578106c58da6cdb0c04543eaba53b7d5a1 /src/pattern.go
parent0994d9c881f8380997b96bb0a4a7416b50bc2b0d (diff)
downloadfzf-01e7668915c4e3cf8c9eeca283d41beac924fe1f.tar.gz
chore: use strings.ReplaceAll (#3801)
Diffstat (limited to 'src/pattern.go')
-rw-r--r--src/pattern.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pattern.go b/src/pattern.go
index cbe73dc4..ee1b88a5 100644
--- a/src/pattern.go
+++ b/src/pattern.go
@@ -155,14 +155,14 @@ func BuildPattern(cache *ChunkCache, patternCache map[string]*Pattern, fuzzy boo
}
func parseTerms(fuzzy bool, caseMode Case, normalize bool, str string) []termSet {
- str = strings.Replace(str, "\\ ", "\t", -1)
+ str = strings.ReplaceAll(str, "\\ ", "\t")
tokens := _splitRegex.Split(str, -1)
sets := []termSet{}
set := termSet{}
switchSet := false
afterBar := false
for _, token := range tokens {
- typ, inv, text := termFuzzy, false, strings.Replace(token, "\t", " ", -1)
+ typ, inv, text := termFuzzy, false, strings.ReplaceAll(token, "\t", " ")
lowerText := strings.ToLower(text)
caseSensitive := caseMode == CaseRespect ||
caseMode == CaseSmart && text != lowerText