Commit fc44fa05 by Evan Brown Committed by Copybara-Service

Add a comment about a more efficient implementation of btree range erase.

PiperOrigin-RevId: 561954737
Change-Id: I0e29a4f4523e4b3eafbd26d1d96f6e1c8deed957
parent a4b11563
...@@ -2534,6 +2534,10 @@ auto btree<P>::rebalance_after_delete(iterator iter) -> iterator { ...@@ -2534,6 +2534,10 @@ auto btree<P>::rebalance_after_delete(iterator iter) -> iterator {
return res; return res;
} }
// Note: we tried implementing this more efficiently by erasing all of the
// elements in [begin, end) at once and then doing rebalancing once at the end
// (rather than interleaving deletion and rebalancing), but that adds a lot of
// complexity, which seems to outweigh the performance win.
template <typename P> template <typename P>
auto btree<P>::erase_range(iterator begin, iterator end) auto btree<P>::erase_range(iterator begin, iterator end)
-> std::pair<size_type, iterator> { -> std::pair<size_type, iterator> {
......
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