chore: rm redundant branch in BinomialHeap.toList

This commit is contained in:
Jannis Limperg 2021-08-13 13:08:49 +02:00 committed by Leonardo de Moura
parent c569c62e85
commit 6ed99b77e9

View file

@ -87,11 +87,10 @@ def tail (lt : αα → Bool) : Heap α → Heap α
let rest := hhs.eraseIdx minIdx
min.children.foldl (merge lt) (heap rest)
partial def toList (lt : αα → Bool) : Heap α → List α
| Heap.empty => []
| h => match head? lt h with
| none => []
| some a => a :: toList lt (tail lt h)
partial def toList (lt : αα → Bool) (h : Heap α) : List α :=
match head? lt h with
| none => []
| some a => a :: toList lt (tail lt h)
inductive WellFormed (lt : αα → Bool) : Heap α → Prop where
| emptyWff : WellFormed lt empty