CountItems returns the total number of Items
(cs []*Chunk)
| 68 | |
| 69 | // CountItems returns the total number of Items |
| 70 | func 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 |
| 83 | func (cl *ChunkList) Push(data []byte) bool { |
no outgoing calls
searching dependent graphs…