|
@@ -89,14 +89,14 @@ func (q *Queue) resize(size int) {
|
|
|
// lazyGrow grows the underlying slice if necessary.
|
|
// lazyGrow grows the underlying slice if necessary.
|
|
|
func (q *Queue) lazyGrow() {
|
|
func (q *Queue) lazyGrow() {
|
|
|
if q.full() {
|
|
if q.full() {
|
|
|
- q.resize(len(q.rep)*2)
|
|
|
|
|
|
|
+ q.resize(len(q.rep) * 2)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// lazyShrink shrinks the underlying slice if advisable.
|
|
// lazyShrink shrinks the underlying slice if advisable.
|
|
|
func (q *Queue) lazyShrink() {
|
|
func (q *Queue) lazyShrink() {
|
|
|
if q.sparse() {
|
|
if q.sparse() {
|
|
|
- q.resize(len(q.rep)/2)
|
|
|
|
|
|
|
+ q.resize(len(q.rep) / 2)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|