Commit fc321dad authored by Victor Costan's avatar Victor Costan Committed by Chromium LUCI CQ

base: Fix complexity of base::ranges::make_heap.

make_heap is linear in the size of the input, not logarithmic.

Change-Id: I88a7c78bfdae4c7dfd09efa433febc6ffdd2d9a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2577034Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834625}
parent ce6d63e2
......@@ -4299,7 +4299,7 @@ constexpr auto pop_heap(Range&& range, Comp comp = {}, Proj proj = {}) {
//
// Returns: `last`.
//
// Complexity: At most `3 log(last - first)` comparisons and twice as many
// Complexity: At most `3 * (last - first)` comparisons and twice as many
// projections.
//
// Reference: https://wg21.link/make.heap#:~:text=ranges::make_heap(I
......@@ -4323,7 +4323,7 @@ constexpr auto make_heap(RandomAccessIterator first,
//
// Returns: `end(range)`.
//
// Complexity: At most `3 log(size(range))` comparisons and twice as many
// Complexity: At most `3 * size(range)` comparisons and twice as many
// projections.
//
// Reference: https://wg21.link/make.heap#:~:text=ranges::make_heap(R
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment