It would be nice to be able to clear an IntervalHeap for re-use, to reduce array allocs and to avoid GC.
Currently ( if I understood correctly ) it can be only cleared with running either while (!iHeap.IsEmpty) iHeap.DeleteMin(); or while (!iHeap.IsEmpty) iHeap.DeleteMax();, which seems less than optimal performance wise.
A iHeap.Clear() method could Array.Clear(heap, 0, size); and then set size = 0
It would be nice to be able to clear an IntervalHeap for re-use, to reduce array allocs and to avoid GC.
Currently ( if I understood correctly ) it can be only cleared with running either
while (!iHeap.IsEmpty) iHeap.DeleteMin();orwhile (!iHeap.IsEmpty) iHeap.DeleteMax();, which seems less than optimal performance wise.A
iHeap.Clear()method couldArray.Clear(heap, 0, size);and then setsize = 0