Skip to content

Commit 6826a04

Browse files
committed
SI-8624 PriorityQueue documentation is not clear enough
Added a paragraph explaining that dequeue is the only way to get your elements in priority order.
1 parent ce7f9f0 commit 6826a04

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/library/scala/collection/mutable/PriorityQueue.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ import generic._
1616
* To prioritize elements of type A there must be an implicit
1717
* Ordering[A] available at creation.
1818
*
19+
* Only the `dequeue` and `dequeueAll` methods will return methods in priority
20+
* order (while removing elements from the heap). Standard collection methods
21+
* including `drop` and `iterator` will remove or traverse the heap in whichever
22+
* order seems most convenient.
23+
*
1924
* @tparam A type of the elements in this priority queue.
2025
* @param ord implicit ordering used to compare the elements of type `A`.
2126
*

0 commit comments

Comments
 (0)