MCPcopy
hub / github.com/junegunn/fzf / Push

Method Push

src/chunklist.go:83–93  ·  view source on GitHub ↗

Push adds the item to the list

(data []byte)

Source from the content-addressed store, hash-verified

81
82// Push adds the item to the list
83func (cl *ChunkList) Push(data []byte) bool {
84 cl.mutex.Lock()
85
86 if len(cl.chunks) == 0 || cl.lastChunk().IsFull() {
87 cl.chunks = append(cl.chunks, &Chunk{})
88 }
89
90 ret := cl.lastChunk().push(cl.trans, data)
91 cl.mutex.Unlock()
92 return ret
93}
94
95// Clear clears the data
96func (cl *ChunkList) Clear() {

Callers 3

TestChunkListFunction · 0.95
TestChunkListTailFunction · 0.95
RunFunction · 0.95

Calls 3

lastChunkMethod · 0.95
pushMethod · 0.80
IsFullMethod · 0.45

Tested by 2

TestChunkListFunction · 0.76
TestChunkListTailFunction · 0.76