mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Simplify erase_one slightly. It's not necessary to preserve
the value of the element to be erased while the heap is being updated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52646 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
55e283c71e
commit
2904538fc3
@ -51,7 +51,7 @@ public:
|
||||
// Logarithmic-time heap bubble-up.
|
||||
while (i != 0) {
|
||||
typename Sequence::size_type parent = (i - 1) / 2;
|
||||
std::swap(this->c[i], this->c[parent]);
|
||||
this->c[i] = this->c[parent];
|
||||
i = parent;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user