m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 23:33:39 -05:00

refactor: use maps.Copy and maps.Clone (#4518)

Signed-off-by: mickychang9 <mickychang9@outlook.com>
This commit is contained in:
mickychang9
2025-09-29 17:11:19 +08:00
committed by GitHub
parent 9bdacc8df2
commit 760d1b7c58
3 changed files with 6 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
package fzf
import (
"maps"
"os"
"sync"
"time"
@@ -225,10 +226,7 @@ func Run(opts *Options) (int, error) {
}
patternBuilder := func(runes []rune) *Pattern {
denyMutex.Lock()
denylistCopy := make(map[int32]struct{})
for k, v := range denylist {
denylistCopy[k] = v
}
denylistCopy := maps.Clone(denylist)
denyMutex.Unlock()
return BuildPattern(cache, patternCache,
opts.Fuzzy, opts.FuzzyAlgo, opts.Extended, opts.Case, opts.Normalize, forward, withPos,