-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Use IndexOfAny in Console's TermInfo #123646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Not a perf sensitive thing, just a bit simpler
|
Tagging subscribers to this area: @dotnet/area-system-console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Simplifies TermInfo printf-format parsing in System.Console by replacing a manual scan loop with IndexOfAny to locate the format terminator.
Changes:
- Replaced a
forloop scanning ford/o/x/X/swithformat.AsSpan(pos).IndexOfAny("doxXs"). - Adjusted the returned index to be absolute (
printfEnd += pos) and preserved existing error behavior when no terminator is found.
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
|
/ba-g unrelated timeout |
Not a perf sensitive thing, just a bit simpler