Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTreeMap: split up range_search into two stages #81094

Merged
merged 1 commit into from
Mar 1, 2021

Conversation

ssomers
Copy link
Contributor

@ssomers ssomers commented Jan 16, 2021

range_search expects 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 initial find_leaf_edges_spanning_range that 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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 16, 2021
@ssomers
Copy link
Contributor Author

ssomers commented Jan 17, 2021

Just noticed that my fancy description applies to code in a parallel universe, and this one isn't quite as elegant.

@ssomers ssomers marked this pull request as draft January 17, 2021 20:18
@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch from d3aee77 to b793c0e Compare January 18, 2021 10:20
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2021
…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`
@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 18, 2021
@ssomers ssomers marked this pull request as ready for review January 18, 2021 21:05
@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch 2 times, most recently from bb63d07 to ec0ba4a Compare January 18, 2021 21:55
@ssomers
Copy link
Contributor Author

ssomers commented Jan 18, 2021

@rustbot modify labels: -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 18, 2021
@bors
Copy link
Contributor

bors commented Jan 19, 2021

☔ The latest upstream changes (presumably #81169) made this pull request unmergeable. Please resolve the merge conflicts.

@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch 3 times, most recently from b601803 to 4ccf0f7 Compare January 21, 2021 10:26
@ssomers
Copy link
Contributor Author

ssomers commented Jan 24, 2021

Splitting off more parts as separate PRs while merge conflicts come in.

@ssomers ssomers marked this pull request as draft January 24, 2021 11:54
@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch from 4ccf0f7 to 769e245 Compare January 24, 2021 12:19
@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 24, 2021
@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch 2 times, most recently from c739e02 to 43ec3f9 Compare January 25, 2021 08:55
@bors
Copy link
Contributor

bors commented Jan 29, 2021

☔ The latest upstream changes (presumably #81073) made this pull request unmergeable. Please resolve the merge conflicts.

@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch from 43ec3f9 to a5d623e Compare January 29, 2021 23:25
@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch from a5d623e to 8d76f5c Compare February 7, 2021 13:17
@bors
Copy link
Contributor

bors commented Feb 7, 2021

☔ The latest upstream changes (presumably #81853) made this pull request unmergeable. Please resolve the merge conflicts.

@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch from 8d76f5c to 5687130 Compare February 7, 2021 19:43
@ssomers ssomers marked this pull request as ready for review February 7, 2021 19:44
@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch from 5687130 to 23f83a8 Compare February 9, 2021 12:41
@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch 2 times, most recently from e619ead to 34978ef Compare February 14, 2021 11:14
@bors
Copy link
Contributor

bors commented Feb 15, 2021

☔ The latest upstream changes (presumably #82103) made this pull request unmergeable. Please resolve the merge conflicts.

@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch 2 times, most recently from 287ded3 to f5e205c Compare February 21, 2021 18:12
@bors
Copy link
Contributor

bors commented Feb 23, 2021

☔ The latest upstream changes (presumably #81937) made this pull request unmergeable. Please resolve the merge conflicts.

@ssomers ssomers force-pushed the btree_drainy_refactor_3 branch from f5e205c to deebb63 Compare February 23, 2021 10:06
@ssomers
Copy link
Contributor Author

ssomers commented Feb 23, 2021

@rustbot modify labels: -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 23, 2021
@Mark-Simulacrum
Copy link
Member

This looks good to me, thanks. @bors r+ rollup=never

@bors
Copy link
Contributor

bors commented Mar 1, 2021

📌 Commit deebb63 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 1, 2021
@bors
Copy link
Contributor

bors commented Mar 1, 2021

⌛ Testing commit deebb63 with merge 3b150b7...

@bors
Copy link
Contributor

bors commented Mar 1, 2021

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 3b150b7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 1, 2021
@bors bors merged commit 3b150b7 into rust-lang:master Mar 1, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 1, 2021
@ssomers ssomers deleted the btree_drainy_refactor_3 branch March 1, 2021 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants