diff --git a/src/chunklist.go b/src/chunklist.go index 63c6078..4a4458a 100644 --- a/src/chunklist.go +++ b/src/chunklist.go @@ -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 }