Ver Fonte

Replace <= with == to make it clearer the size is always a power of two

Evan Huus há 10 anos atrás
pai
commit
f4e18e921e
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      queue.go

+ 1 - 1
queue.go

@@ -82,7 +82,7 @@ func (q *Queue) Remove() {
 	q.buf[q.head] = nil
 	q.head = (q.head + 1) % len(q.buf)
 	q.count--
-	if len(q.buf) > minQueueLen && q.count*4 <= len(q.buf) {
+	if len(q.buf) > minQueueLen && q.count*4 == len(q.buf) {
 		q.resize()
 	}
 }