Simplify control flow in _Traits_find_MEOW_not_of#5006
Merged
StephanTLavavej merged 11 commits intomicrosoft:mainfrom Oct 12, 2024
Merged
Simplify control flow in _Traits_find_MEOW_not_of#5006StephanTLavavej merged 11 commits intomicrosoft:mainfrom
_Traits_find_MEOW_not_of#5006StephanTLavavej merged 11 commits intomicrosoft:mainfrom
Conversation
Except in `_Traits_find_last_of`, which is being changed by GH 4934.
This will simplify the following transformation.
Both sides unconditionally return, allowing us to flip them. (One case is a forever loop where the only ways out are returns.)
This comment was marked as resolved.
This comment was marked as resolved.
In `_Traits_meow` functions with `if (condition) { woof; } return;` where `woof` is a `for` containing at least two `if`s.
CaseyCarter
approved these changes
Oct 10, 2024
Contributor
CaseyCarter
left a comment
There was a problem hiding this comment.
This is such a nice simplification, I thought I'd push another commit to do some early-return outdenting.
... to avoid merge conflicts with microsoftGH-4934. This partially reverts commit 8d902d9.
CaseyCarter
approved these changes
Oct 10, 2024
These return statements are never reached.
Member
Author
|
😻 Looks purr to me! |
Member
Author
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Contributor
|
A merge conflict? Couldn't be me. |
Member
Author
|
Remember, I named you Casey "Conflict" Carter via office post-it note almost a decade ago! 🎯 💯 🔮 |
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.
This simplifies
_Traits_find_first_not_ofand_Traits_find_last_not_of, following the patterns in #4744 and #4934, which will make them easier to understand and easier to add vectorized codepaths. These are lossless transformations that don't affect behavior.breaks with immediatereturns._Traits_find_last_of, which is being changed by Vectorizebasic_string::find_last_of#4934.returninstead of relying on fall-through.!_Matches._Marktests._Special=false" to fall-through._Elem._Hay_start,_Hay_end.bool _Specialinto its usage.