mirror of
https://github.com/peco/peco.git
synced 2026-09-10 07:16:29 -04:00
fix: lint issues in matched pool
This commit is contained in:
parent
a5c51bcc4b
commit
6be528ba24
|
|
@ -96,7 +96,7 @@ func BenchmarkRegexpFilterMultiCycle(b *testing.B) {
|
|||
b.ResetTimer()
|
||||
for b.Loop() {
|
||||
// Simulate 3 keystroke cycles
|
||||
for cycle := 0; cycle < 3; cycle++ {
|
||||
for range 3 {
|
||||
ctx := f.NewContext(context.Background(), query)
|
||||
ch := make(chan line.Line, numLines)
|
||||
_ = f.Apply(ctx, lines, pipeline.ChanOutput(ch))
|
||||
|
|
|
|||
|
|
@ -12,7 +12,10 @@ var matchedPool = sync.Pool{
|
|||
|
||||
// GetMatched retrieves a Matched from the pool and initializes it.
|
||||
func GetMatched(rl Line, matches [][]int) *Matched {
|
||||
m := matchedPool.Get().(*Matched)
|
||||
m, ok := matchedPool.Get().(*Matched)
|
||||
if !ok {
|
||||
m = &Matched{}
|
||||
}
|
||||
m.Line = rl
|
||||
m.indices = matches
|
||||
return m
|
||||
|
|
|
|||
Loading…
Reference in a new issue