BTreeMap: split up range_search into two stages#81094
BTreeMap: split up range_search into two stages#81094bors merged 1 commit intorust-lang:masterfrom ssomers:btree_drainy_refactor_3
Conversation
|
Just noticed that my fancy description applies to code in a parallel universe, and this one isn't quite as elegant. |
…Simulacrum BTreeMap: convert search functions to methods And further tweak the signature of `search_linear`, in preparation of a better rust-lang#81094. r? `@Mark-Simulacrum`
|
@rustbot modify labels: -S-waiting-on-author +S-waiting-on-review |
|
☔ The latest upstream changes (presumably #81169) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Splitting off more parts as separate PRs while merge conflicts come in. |
|
☔ The latest upstream changes (presumably #81073) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (presumably #81853) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (presumably #82103) made this pull request unmergeable. Please resolve the merge conflicts. |
|
☔ The latest upstream changes (presumably #81937) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@rustbot modify labels: -S-waiting-on-author +S-waiting-on-review |
|
This looks good to me, thanks. @bors r+ rollup=never |
|
📌 Commit deebb63 has been approved by |
|
☀️ Test successful - checks-actions |
range_searchexpects the caller to pass the same root twice and starts searching a node for both bounds of a range. It's not very clear that in the early iterations, it searches twice in the same node. This PR splits that search up in an initialfind_leaf_edges_spanning_rangethat postpones aliasing until the last second, and a second phase for continuing the search for the range in the each subtree independently (find_lower_bound_edge&find_upper_bound_edge), which greatly helps for use in #81075. It also moves those functions over to the search module.r? @Mark-Simulacrum