MCPcopy
hub / github.com/kopia/kopia / Dup

Method Dup

internal/gather/gather_write_buffer.go:159–169  ·  view source on GitHub ↗

Dup creates a clone of the WriteBuffer.

()

Source from the content-addressed store, hash-verified

157
158// Dup creates a clone of the WriteBuffer.
159func (b *WriteBuffer) Dup() *WriteBuffer {
160 dup := &WriteBuffer{}
161
162 b.mu.Lock()
163 defer b.mu.Unlock()
164
165 dup.alloc = b.alloc
166 dup.inner = FromSlice(b.inner.ToByteSlice())
167
168 return dup
169}
170
171// NewWriteBuffer creates new write buffer.
172func NewWriteBuffer() *WriteBuffer {

Calls 4

FromSliceFunction · 0.85
LockMethod · 0.65
UnlockMethod · 0.65
ToByteSliceMethod · 0.45

Tested by 1