Skip to content
Myr

Remove non-exclusive access to ChunkList field

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 99927c7 · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:src/chunklist.go+2 added-1 removed
73 unmodified lines
74func (cl *ChunkList) Snapshot() ([]*Chunk, int) {75 cl.mutex.Lock()7677 ret := make([]*Chunk, len(cl.chunks))78 count := cl.count79 copy(ret, cl.chunks)8081 // Duplicate the last chunk82 if cnt := len(ret); cnt > 0 {
1 unmodified line
84 ret[cnt-1] = &newChunk85 }8687 cl.mutex.Unlock()87 return ret, cl.count88 return ret, count89}