You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dequeue for PriorityQueue should return Key-Value Pair not just Key #845
Generally, the dequeue operation is to retrieve the value in a path-planning tree search. As currently implemented, one needs to call peek() to get to the "best" value (best is lowest or highest depending on direction), followed by dequeue!() to remove it. This is cumbersome and inefficient (two calls to get "best").
make dequeue! return the same as peek
Activity
hdavid16 commentedon Apr 27, 2023
There is
dequeue_pair!to do this. However, I do agree that it makes sense to just havedequeue!do this.micampbell commentedon Apr 27, 2023
I didn't know of
dequeue_pair!. That solves it, but this semantic choice is antithetical to all other programming languages.hdavid16 commentedon Apr 27, 2023
I totally agree with you! I would recommend keeping this issue open since this syntax is not ideal for users.
micampbell commentedon Apr 27, 2023
well, if you think it isn't too late to change....re-opened
hdavid16 commentedon Apr 28, 2023
It looks like #479 removes these and replaces them with
popfirst!, which behaves asdequeue_pair!. This is to conform with Julia base.aoanla commentedon Dec 17, 2023