mirror of
https://github.com/junegunn/fzf.git
synced 2025-07-31 04:02:01 -07:00
Remove non-exclusive access to ChunkList field
This commit is contained in:
@@ -75,6 +75,7 @@ func (cl *ChunkList) Snapshot() ([]*Chunk, int) {
|
||||
cl.mutex.Lock()
|
||||
|
||||
ret := make([]*Chunk, len(cl.chunks))
|
||||
count := cl.count
|
||||
copy(ret, cl.chunks)
|
||||
|
||||
// Duplicate the last chunk
|
||||
@@ -84,5 +85,5 @@ func (cl *ChunkList) Snapshot() ([]*Chunk, int) {
|
||||
}
|
||||
|
||||
cl.mutex.Unlock()
|
||||
return ret, cl.count
|
||||
return ret, count
|
||||
}
|
||||
|
Reference in New Issue
Block a user