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

Function CountItems

src/chunklist.go:70–80  ·  view source on GitHub ↗

CountItems returns the total number of Items

(cs []*Chunk)

Source from the content-addressed store, hash-verified

68
69// CountItems returns the total number of Items
70func CountItems(cs []*Chunk) int {
71 if len(cs) == 0 {
72 return 0
73 }
74 if len(cs) == 1 {
75 return cs[0].count
76 }
77
78 // First chunk might not be full due to --tail=N
79 return cs[0].count + chunkSize*(len(cs)-2) + cs[len(cs)-1].count
80}
81
82// Push adds the item to the list
83func (cl *ChunkList) Push(data []byte) bool {

Callers 4

LoopMethod · 0.85
SnapshotMethod · 0.85
TestChunkListTailFunction · 0.85
RunFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestChunkListTailFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…