diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:30:07 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:32:57 +0900 |
commit | 71d216b90256936a9638f325af9bc69d720e75de (patch) | |
tree | 9c5f682d341c7c88ad0c8e3d4b262e00b6fb691a /boost/heap/fibonacci_heap.hpp | |
parent | 733b5d5ae2c5d625211e2985ac25728ac3f54883 (diff) | |
download | boost-71d216b90256936a9638f325af9bc69d720e75de.tar.gz boost-71d216b90256936a9638f325af9bc69d720e75de.tar.bz2 boost-71d216b90256936a9638f325af9bc69d720e75de.zip |
Imported Upstream version 1.59.0
Change-Id: I2dde00f4eca71df3eea9d251dcaecde18a6c90a5
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/heap/fibonacci_heap.hpp')
-rw-r--r-- | boost/heap/fibonacci_heap.hpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/boost/heap/fibonacci_heap.hpp b/boost/heap/fibonacci_heap.hpp index 4397d565ee..10a1ce3a5e 100644 --- a/boost/heap/fibonacci_heap.hpp +++ b/boost/heap/fibonacci_heap.hpp @@ -432,14 +432,7 @@ public: * */ void update (handle_type handle) { - node_pointer n = handle.node_; - node_pointer parent = n->get_parent(); - - if (parent) { - n->parent = NULL; - roots.splice(roots.begin(), parent->children, node_list_type::s_iterator_to(*n)); - } - add_children_to_root(n); + update_lazy(handle); consolidate(); } @@ -458,6 +451,9 @@ public: roots.splice(roots.begin(), parent->children, node_list_type::s_iterator_to(*n)); } add_children_to_root(n); + + if (super_t::operator()(top_element->value, n->value)) + top_element = n; } @@ -735,7 +731,7 @@ private: aux[node_rank] = n; } - if (super_t::operator()(top_element->value, n->value)) + if (!super_t::operator()(n->value, top_element->value)) top_element = n; } while (it != roots.end()); |