I've run across what I believe was an oversight in mutable.PriorityQueue.
The newBuilder method in object PriorityQueue is defined as
def newBuilder[A](implicit ord: Ordering[A]) = new PriorityQueue[A]
The lack of a return type means that the type in the API comes out as
def newBuilder[A](implicit ord: Ordering[A]): PriorityQueue[A]
rather than the expected
def newBuilder[A](implicit ord: Ordering[A]): Builder[A, PriorityQueue[A]]
I ran across this because I was dismayed to discover that creating a new
priority queue takes O(N log N) time when it can easily be done in O(N)
time. Well, easily in the algorithmic sense anyway. The codefix is
unnecessarily complicated by this type leak in the API.
Similar algorithmic improvements can be made to improve the running times of
enqueue, ++=, and reverse.
I would be happy to contribute, but the CONTRIBUTING doc says to post here first.