Skip to content

Conversation

@stephentoub
Copy link
Member

Cleans up the generated code a bit, removing some unnecessary code:

  • If TryFindNextPossibleStartingPosition has no information to use to do something helpful, there's no point in emitting it.
  • Simplify the Scan loop structure
  • Avoid emitting a minimum length required check if the minimum is 0, as we'll never have a position that fails that check.
  • Avoid a return false; code path in TryFindNextPossibleStartingPosition if it'll never be used.

Cleans up the generated code a bit, removing some unnecessary code:
- If TryFindNextPossibleStartingPosition has no information to use to do something helpful, there's no point in emitting it.
- Simplify the Scan loop structure
- Avoid emitting a minimum length required check if the minimum is 0, as we'll never have a position that fails that check.
- Avoid a `return false;` code path in TryFindNextPossibleStartingPosition if it'll never be used.
@ghost
Copy link

ghost commented Apr 26, 2022

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

Issue Details

Cleans up the generated code a bit, removing some unnecessary code:

  • If TryFindNextPossibleStartingPosition has no information to use to do something helpful, there's no point in emitting it.
  • Simplify the Scan loop structure
  • Avoid emitting a minimum length required check if the minimum is 0, as we'll never have a position that fails that check.
  • Avoid a return false; code path in TryFindNextPossibleStartingPosition if it'll never be used.
Author: stephentoub
Assignees: -
Labels:

area-System.Text.RegularExpressions

Milestone: 7.0.0

Copy link
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a small question, but other than that this looks good.

@stephentoub stephentoub merged commit 8dec3ce into dotnet:main Apr 26, 2022
@stephentoub stephentoub deleted the tweakscanloop branch April 26, 2022 19:11
@stephentoub
Copy link
Member Author

Thanks for reviewing.

@ghost ghost locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants