Skip to content
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

Remove() returns item removed. #13

Merged
merged 1 commit into from
Aug 5, 2016
Merged

Remove() returns item removed. #13

merged 1 commit into from
Aug 5, 2016

Conversation

gammazero
Copy link
Contributor

The reason I am suggesting this change is because for many of my uses of queue, I remove an item in each iteration of a loop:

for q.Length() > 0 {
    x := q.Remove()
    ...

Only in some cases (e.g. your channels) do I find a need to do a Peek() and remove separately.

@eapache
Copy link
Owner

eapache commented Aug 5, 2016

Looks great.

@eapache eapache merged commit 44cc805 into eapache:master Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants