Skip to content

Commit 7624e28

Browse files
authored
Merge pull request scala/scala#7144 from martijnhoekstra/SI-11079
Update documentation of PriorityQueue
2 parents f15f3a2 + 12d8c5a commit 7624e28

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ import generic._
1515
/** This class implements priority queues using a heap.
1616
* To prioritize elements of type A there must be an implicit
1717
* Ordering[A] available at creation.
18+
*
19+
* If multiple elements have the same priority in the ordering of this
20+
* PriorityQueue, no guarantees are made regarding the order in which elements
21+
* are returned by `dequeue` or `dequeueAll`. In particular, that means this
22+
* class does not guarantee first in first out behaviour that may be
23+
* incorrectly inferred from the Queue part of the name of this class.
1824
*
1925
* Only the `dequeue` and `dequeueAll` methods will return elements in priority
2026
* order (while removing elements from the heap). Standard collection methods

0 commit comments

Comments
 (0)