aboutsummaryrefslogtreecommitdiff
path: root/gcc/fibonacci_heap.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fibonacci_heap.h')
-rw-r--r--gcc/fibonacci_heap.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/fibonacci_heap.h b/gcc/fibonacci_heap.h
index 0d9226b..2e74176f 100644
--- a/gcc/fibonacci_heap.h
+++ b/gcc/fibonacci_heap.h
@@ -457,7 +457,7 @@ fibonacci_heap<K,V>::union_with (fibonacci_heap<K,V> *heapb)
{
fibonacci_heap<K,V> *heapa = this;
- fibonacci_node<K,V> *a_root, *b_root, *temp;
+ fibonacci_node<K,V> *a_root, *b_root;
/* If one of the heaps is empty, the union is just the other heap. */
if ((a_root = heapa->m_root) == NULL)
@@ -474,9 +474,7 @@ fibonacci_heap<K,V>::union_with (fibonacci_heap<K,V> *heapb)
/* Merge them to the next nodes on the opposite chain. */
a_root->m_left->m_right = b_root;
b_root->m_left->m_right = a_root;
- temp = a_root->m_left;
- a_root->m_left = b_root->m_left;
- b_root->m_left = temp;
+ std::swap (a_root->m_left, b_root->m_left);
heapa->m_nodes += heapb->m_nodes;
/* And set the new minimum, if it's changed. */