summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/PriorityQueue.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-23 21:46:21 +0000
committerDan Gohman <gohman@apple.com>2008-06-23 21:46:21 +0000
commit2904538fc30fbdc2788802ca7389482d5e20a717 (patch)
treedb722c515af3b3359412eecd67e0f736a954bc92 /include/llvm/ADT/PriorityQueue.h
parent55e283c71eaa0428b63c901d726c0666f985ce85 (diff)
downloadllvm-2904538fc30fbdc2788802ca7389482d5e20a717.tar.gz
llvm-2904538fc30fbdc2788802ca7389482d5e20a717.tar.bz2
llvm-2904538fc30fbdc2788802ca7389482d5e20a717.tar.xz
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
Diffstat (limited to 'include/llvm/ADT/PriorityQueue.h')
-rw-r--r--include/llvm/ADT/PriorityQueue.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/PriorityQueue.h b/include/llvm/ADT/PriorityQueue.h
index 1cff0f2a0c..2503f75e81 100644
--- a/include/llvm/ADT/PriorityQueue.h
+++ b/include/llvm/ADT/PriorityQueue.h
@@ -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;
}