[PATCH] Remove __gnu_pbds::detail::binary_heap::is_heap (PR libstdc++/62045) [resend]

Jonathan Wakely jwakely@redhat.com
Wed Mar 15 20:13:00 GMT 2017


On 10/03/17 11:54 +0000, Jonathan Wakely wrote:
>On 10/03/17 19:36 +0800, Xi Ruoyao wrote:
>>Hi,
>>
>>This was resent to be in both libstdc++ and gcc-patches list.
>
>Thanks.
>
>>The ill-formed checking in binary_heap::push_heap has made it
>>O(n). Remove this checking.
>
>The checking certainly looks redundant, I wouldn't say ill-formed
>though (that's a formal term in the C++ standard meaning the code
>isn't valid C++).
>
>>Since assert_valid also checks if (*this) is a legal heap, we can
>>remove is_heap and the assertions using it completely.
>
>The patch looks good, and since you're just removing code I don't
>think we need a copyright assignment. I'll get this applied to the
>active branches, thanks!


I've committed the patch, with a new test to verify that we don't do
too many comparisons on insertion. Thanks again.

Tested powerpc64le-linux, committed to trunk. Backports to follow.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 5070 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170315/b33c7de3/attachment.bin>


More information about the Gcc-patches mailing list