Skip to content

Cleanup #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 21, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Replace <= with == to make it clearer the size is always a power of two
  • Loading branch information
eapache committed Mar 21, 2015
commit f4e18e921eb877d9d30ffe75b537d07ad8f46370
2 changes: 1 addition & 1 deletion queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}