jameysharp opened PR #5131 from overlap-cleanup
to main
:
Now that we aren't trying to do overlap checking in parallel, we can fuse the loop that generates a list of rule pairs with the loop that checks those pairs.
Removing the intermediate vector of pairs should save a little time and memory. But it also means we're no longer borrowing from the
by_term
HashMap, so we can useinto_iter
instead ofvalues
to move ownership out of the map. That in turn means that we can useinto_iter
on each vector of rules as well, which turns out to offer a slightly nicer idiom for looping over all pairs, and also means we drop allocations as soon as possible.I also pushed grouping by priority earlier, so the O(n^2) all-pairs loop runs over smaller lists. If we later find we want to know about overlaps across different priorities, the definition of the map key is an easy place to make that change.
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
jameysharp requested elliottt for a review on PR #5131.
elliottt submitted PR review.
jameysharp has enabled auto merge for PR #5131.
jameysharp merged PR #5131.
Last updated: Dec 23 2024 at 13:07 UTC