MCPcopy
hub / github.com/rclone/rclone / getN

Method getN

lib/pool/pool.go:112–117  ·  view source on GitHub ↗

getN gets the last n buffers in bp.cache will panic if you ask for too many buffers Call with mu held

(n int)

Source from the content-addressed store, hash-verified

110//
111// Call with mu held
112func (bp *Pool) getN(n int) [][]byte {
113 i := len(bp.cache) - n
114 bufs := slices.Clone(bp.cache[i:])
115 bp.cache = slices.Delete(bp.cache, i, len(bp.cache))
116 return bufs
117}
118
119// put puts the buffer on the end of bp.cache
120//

Callers 1

GetNMethod · 0.95

Calls 1

DeleteMethod · 0.65

Tested by

no test coverage detected