Skip to content

Commit

Permalink
remved concurrent memory read
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima Koss committed Jan 27, 2024
1 parent b81fbce commit e757bcd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/internalpipe/any.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package internalpipe

import "sync"
import (
"sync"
)

const hugeLenStep = 1 << 15

Expand Down Expand Up @@ -65,9 +67,9 @@ func (p Pipe[T]) Any() *T {
}

for j := lf; j < rg; j++ {
// mx.Lock()
mx.Lock()
rs := resSet
// mx.Unlock()
mx.Unlock()
if !rs {
obj, skipped := p.Fn(j)
if !skipped {
Expand Down

0 comments on commit e757bcd

Please sign in to comment.