diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-27 10:13:12 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-27 10:13:12 +0000 |
commit | e0e4357b88efe5dc53e50d341a09de4d02331200 (patch) | |
tree | cafff2748190357bac05d69d344e79b0e38d1e27 /gcc/fibonacci_heap.h | |
parent | 7b48bf2011b4020c4a5a2d5d4149b03983f72cc2 (diff) | |
download | gcc-tarball-e0e4357b88efe5dc53e50d341a09de4d02331200.tar.gz |
gcc-6.1.0gcc-6.1.0
Diffstat (limited to 'gcc/fibonacci_heap.h')
-rw-r--r-- | gcc/fibonacci_heap.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/fibonacci_heap.h b/gcc/fibonacci_heap.h index 0d9226bbca..c6c2a45b6b 100644 --- a/gcc/fibonacci_heap.h +++ b/gcc/fibonacci_heap.h @@ -1,5 +1,5 @@ /* Vector API for GNU compiler. - Copyright (C) 1998-2015 Free Software Foundation, Inc. + Copyright (C) 1998-2016 Free Software Foundation, Inc. Contributed by Daniel Berlin (dan@cgsoftware.com). Re-implemented in C++ by Martin Liska <mliska@suse.cz> @@ -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. */ |