浏览代码

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

Evan Huus 10 年之前
父节点
当前提交
f4e18e921e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      queue.go

+ 1 - 1
queue.go

@@ -82,7 +82,7 @@ func (q *Queue) Remove() {
 	q.buf[q.head] = nil
 	q.buf[q.head] = nil
 	q.head = (q.head + 1) % len(q.buf)
 	q.head = (q.head + 1) % len(q.buf)
 	q.count--
 	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()
 		q.resize()
 	}
 	}
 }
 }