Blame boost-1.58-binomial_heap.patch
|
Jonathan Wakely |
783423 |
From 8091fbf00ae6953d34b717ab077a041420e5ba43 Mon Sep 17 00:00:00 2001
|
|
Jonathan Wakely |
783423 |
From: Tim Blechmann <tim@klingt.org>
|
|
Jonathan Wakely |
783423 |
Date: Sat, 5 Sep 2015 09:04:32 +0200
|
|
Jonathan Wakely |
783423 |
Subject: [PATCH] heap: binomial heap - fix size handling in pop()
|
|
Jonathan Wakely |
783423 |
|
|
Jonathan Wakely |
783423 |
---
|
|
Jonathan Wakely |
783423 |
include/boost/heap/binomial_heap.hpp | 5 +++++
|
|
Jonathan Wakely |
783423 |
1 file changed, 5 insertions(+)
|
|
Jonathan Wakely |
783423 |
|
|
Jonathan Wakely |
783423 |
diff --git a/include/boost/heap/binomial_heap.hpp b/include/boost/heap/binomial_heap.hpp
|
|
Jonathan Wakely |
783423 |
index 7e0760f..01ccf3f 100644
|
|
Jonathan Wakely |
783423 |
--- a/include/boost/heap/binomial_heap.hpp
|
|
Jonathan Wakely |
783423 |
+++ b/include/boost/heap/binomial_heap.hpp
|
|
Jonathan Wakely |
783423 |
@@ -404,8 +404,13 @@ class binomial_heap:
|
|
Jonathan Wakely |
783423 |
binomial_heap children(value_comp(), element->children, sz);
|
|
Jonathan Wakely |
783423 |
if (trees.empty()) {
|
|
Jonathan Wakely |
783423 |
stability_counter_type stability_count = super_t::get_stability_count();
|
|
Jonathan Wakely |
783423 |
+ size_t size = constant_time_size ? size_holder::get_size()
|
|
Jonathan Wakely |
783423 |
+ : 0;
|
|
Jonathan Wakely |
783423 |
swap(children);
|
|
Jonathan Wakely |
783423 |
super_t::set_stability_count(stability_count);
|
|
Jonathan Wakely |
783423 |
+
|
|
Jonathan Wakely |
783423 |
+ if (constant_time_size)
|
|
Jonathan Wakely |
783423 |
+ size_holder::set_size( size );
|
|
Jonathan Wakely |
783423 |
} else
|
|
Jonathan Wakely |
783423 |
merge_and_clear_nodes(children);
|
|
Jonathan Wakely |
783423 |
|