Skip to content

Remove() returns item removed.#13

Merged
eapache merged 1 commit intoeapache:masterfrom
gammazero:master
Aug 5, 2016
Merged

Remove() returns item removed.#13
eapache merged 1 commit intoeapache:masterfrom
gammazero:master

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