| 1 | package bufferscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ |
| 2 | |
| 3 | import "mathscip-go gomod github.com/golang/go/src go1.13 math/" |
| 4 | |
| 5 | // ListAt is a slice of BufferAt's, it's the backing for NewPartitionAt |
| 6 | type ListAtscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt# []BufferAtscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/BufferAt# |
| 7 | |
| 8 | // Len is the sum of the Len()'s of the BufferAt's in the list. |
| 9 | func (l *ListAtscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#) Lenscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#Len().() (n int64) { |
| 10 | for _, buffer := range *l { |
| 11 | if n > mathscip-go gomod github.com/golang/go/src go1.13 math/.MaxInt64scip-go gomod github.com/golang/go/src go1.13 math/MaxInt64.-buffer.Lenscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/Buffer#Len.() { |
| 12 | return mathscip-go gomod github.com/golang/go/src go1.13 math/.MaxInt64scip-go gomod github.com/golang/go/src go1.13 math/MaxInt64. |
| 13 | } |
| 14 | n += buffer.Lenscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/Buffer#Len.() |
| 15 | } |
| 16 | return n |
| 17 | } |
| 18 | |
| 19 | // Cap is the sum of the Cap()'s of the BufferAt's in the list. |
| 20 | func (l *ListAtscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#) Capscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#Cap().() (n int64) { |
| 21 | for _, buffer := range *l { |
| 22 | if n > mathscip-go gomod github.com/golang/go/src go1.13 math/.MaxInt64scip-go gomod github.com/golang/go/src go1.13 math/MaxInt64.-buffer.Capscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/Buffer#Cap.() { |
| 23 | return mathscip-go gomod github.com/golang/go/src go1.13 math/.MaxInt64scip-go gomod github.com/golang/go/src go1.13 math/MaxInt64. |
| 24 | } |
| 25 | n += buffer.Capscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/Buffer#Cap.() |
| 26 | } |
| 27 | return n |
| 28 | } |
| 29 | |
| 30 | // Reset calls Reset() on each of the BufferAt's in the list. |
| 31 | func (l *ListAtscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#) Resetscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#Reset().() { |
| 32 | for _, buffer := range *l { |
| 33 | buffer.Resetscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/Buffer#Reset.() |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // Push adds a BufferAt to the end of the list |
| 38 | func (l *ListAtscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#) Pushscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#Push().(b BufferAtscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/BufferAt#) { |
| 39 | *l = append(*l, b) |
| 40 | } |
| 41 | |
| 42 | // Pop removes and returns a BufferAt from the front of the list |
| 43 | func (l *ListAtscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#) Popscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/ListAt#Pop().() (b BufferAtscip-go gomod github.com/djherbis/buffer . `github.com/djherbis/buffer`/BufferAt#) { |
| 44 | b = (*l)[0] |
| 45 | *l = (*l)[1:] |
| 46 | return b |
| 47 | } |