-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streamline String.Substring (#73882)
- Split the one-arg Substring from the two-arg Substring to avoid unnecessary checks in the former - Employ the same argument validation checks as Span, and then delegate to a helper that does more detailed checking to throw the right exception - Avoid duplicative checks in the body - Reorder checks in one-arg overload to do success paths before error paths where possible
- Loading branch information
1 parent
4c24000
commit a037f0c
Showing
1 changed file
with
35 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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