Replace many redundant uses of IsContainedInSpan#6287
Merged
Conversation
Instead use the return value by CloseMutableBasis (which was not always there but added in 2019, which explains why so much code did not make use of it). This essentially avoids doing the same computation twice, and can have a quite noticeable performance benefit in some cases.
ThomasBreuer
approved these changes
Mar 27, 2026
Contributor
ThomasBreuer
left a comment
There was a problem hiding this comment.
Nice.
(I do not remember the circumstances of #3247,
in particular why the code was not improved already at that time.)
Member
Author
|
Note that also a bunch of packages could potentially benefit from similar changes, basically all that use |
9 tasks
cdwensley
pushed a commit
to cdwensley/gap
that referenced
this pull request
Apr 1, 2026
Instead use the return value by CloseMutableBasis (which was not always there but added in 2019, which explains why so much code did not make use of it). This essentially avoids doing the same computation twice, and can have a quite noticeable performance benefit in some cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead use the return value by CloseMutableBasis (which was not always there but was added by @ThomasBreuer in 2019 in PR #3247), which explains why so much code did not make use of it).
This essentially avoids doing the same computation twice, and can have a quite noticeable performance benefit in some cases.