PR libstdc++/62045 fix O(N) insertion in pd_ds binary heap
commitc50553a1f30dc6be4f91086d1d41fd7dbf10db5d
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Mar 2017 20:11:48 +0000 (15 20:11 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 15 Mar 2017 20:11:48 +0000 (15 20:11 +0000)
tree378a37f9de23aceafda17406a7f093e8bfdf74d5
parent101d9cf4b599388f7f0168d49bcf89418579f72a
PR libstdc++/62045 fix O(N) insertion in pd_ds binary heap

2017-03-15  Xi Ruoyao  <ryxi@stu.xidian.edu.cn>

PR libstdc++/62045
* include/ext/pb_ds/qdetail/binary_heap_/binary_heap_.hpp
(is_heap): Remove.
(push_heap): Remove the wrong checking using is_heap.
(make_heap): Remove the assertion using is_heap.
* include/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
(modify): Ditto.
(resize_for_insert_if_needed): Add PB_DS_ASSERT_VALID after
calling make_heap.

2017-03-15  Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/62045
* testsuite/ext/pb_ds/regression/priority_queue_binary_heap-62045.cc:
New test.
* testsuite/ext/pb_ds/regression/priority_queues.cc: Fix copy&paste
error in comment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246173 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queue_binary_heap-62045.cc [new file with mode: 0644]
libstdc++-v3/testsuite/ext/pb_ds/regression/priority_queues.cc