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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user