diff options
Diffstat (limited to 'src/chunklist.go')
-rw-r--r-- | src/chunklist.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/chunklist.go b/src/chunklist.go index 510cd734..cd635c25 100644 --- a/src/chunklist.go +++ b/src/chunklist.go @@ -64,6 +64,13 @@ func (cl *ChunkList) Push(data []byte) bool { return ret } +// Clear clears the data +func (cl *ChunkList) Clear() { + cl.mutex.Lock() + cl.chunks = nil + cl.mutex.Unlock() +} + // Snapshot returns immutable snapshot of the ChunkList func (cl *ChunkList) Snapshot() ([]*Chunk, int) { cl.mutex.Lock() |