MCPcopy
hub / github.com/awnumar/memguard / remove

Method remove

core/buffer.go:288–298  ·  view source on GitHub ↗

Remove removes a given Buffer from the list.

(b *Buffer)

Source from the content-addressed store, hash-verified

286
287// Remove removes a given Buffer from the list.
288func (l *bufferList) remove(b *Buffer) {
289 l.Lock()
290 defer l.Unlock()
291
292 for i, v := range l.list {
293 if v == b {
294 l.list = append(l.list[:i], l.list[i+1:]...)
295 break
296 }
297 }
298}
299
300// Exists checks if a given buffer is in the list.
301func (l *bufferList) exists(b *Buffer) bool {

Callers 4

DestroyMethod · 0.80
TestPurgeFunction · 0.80
TestBufferListFunction · 0.80
DestroyMethod · 0.80

Calls

no outgoing calls

Tested by 2

TestPurgeFunction · 0.64
TestBufferListFunction · 0.64