diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2025-04-11 16:52:54 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2025-04-11 16:52:54 -0700 |
| commit | 61e0e125f343eb07b29029290ad4105ad7ff6bdc (patch) | |
| tree | 14cfa283e2654c03d4572431c40a60d8157d7898 /deque.go | |
| parent | Fix a bug in PopAll when the queue is full (diff) | |
| download | deque-61e0e125f343eb07b29029290ad4105ad7ff6bdc.tar.zst | |
Get rid of AvailableBuffer
It's probably fine, but I don't want to commit to it before v1.
Diffstat (limited to 'deque.go')
| -rw-r--r-- | deque.go | 11 |
1 files changed, 0 insertions, 11 deletions
@@ -106,17 +106,6 @@ func (q *Deque[T]) Reset() { q.buf = q.buf[:0] } -// AvailableBuffer returns an empty slice with q.Cap()-q.Len() capacity. This -// slice is intended to be appended to and passed to an immediately succeeding -// Deque.PushBack call. The slice is only valid until the next push operation on q. -func (q *Deque[T]) AvailableBuffer() []T { - endIdx := q.toPhysicalIdx(len(q.buf)) - if endIdx <= q.head { - return q.buf[endIdx:endIdx:q.head] - } - return q.buf[endIdx:endIdx] -} - // Grow makes space for at least n more elements to be inserted in the given // deque without reallocation. func (q *Deque[T]) Grow(n int) { |
