Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions std/container/binaryheap.d
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ and $(D length == capacity), throws an exception.
return 1;
}

/**
Removes the largest element from the heap.
/**
Removes the largest element from the heap.
*/
void removeFront()
{
Expand All @@ -326,6 +326,8 @@ Removes the largest element from the heap.
_store[_length - 1] = move(t1);
}
--_length;
// Break GC reachability of the removed element
_store[length] = typeof(_store[_length]).init;
percolate(_store[], 0, _length);
}

Expand Down
Loading