Conversation
Codecov Report
@@ Coverage Diff @@
## master #253 +/- ##
==========================================
+ Coverage 91.23% 91.24% +<.01%
==========================================
Files 24 24
Lines 1621 1622 +1
Branches 227 217 -10
==========================================
+ Hits 1479 1480 +1
Misses 142 142
Continue to review full report at Codecov.
|
|
|
||
| def toIterator(implicit order: Order[A]): Iterator[A] = { | ||
| @scala.annotation.tailrec | ||
| def build(heap: Heap[A], acc: Stream[A]): Stream[A] = heap match { |
There was a problem hiding this comment.
Why is using a Stream better than just building the List below? Since it is tailrec you are building the whole Stream no? If we do that, isn’t a List cheaper?
There was a problem hiding this comment.
in list you have to reverse it at the end.
There was a problem hiding this comment.
In this particular case the following does not apply, but in the other implementations, the stream based removed the need for mutations, and adds stateless build of the iterator.
There was a problem hiding this comment.
If we are making a performance argument, can we show a win with benchmarks?
There was a problem hiding this comment.
Oh man, you are killing me... I haven't written one of those in a while. Let me see
No description provided.