-
Couldn't load subscription status.
- Fork 5.2k
Use switch statement to map socket errors #120364
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
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
This PR modernizes the socket error mapping implementation by replacing dictionary-based lookups with switch expressions for better performance and readability.
Key changes:
- Replaces dictionary-based error mapping with switch expressions
- Removes debug assertions and associated constants for dictionary count validation
- Consolidates mapping logic into shared helper methods
src/libraries/Common/src/System/Net/Sockets/SocketErrorPal.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/src/System/Net/Sockets/SocketErrorPal.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/src/System/Net/Sockets/SocketErrorPal.Unix.cs
Outdated
Show resolved
Hide resolved
|
Tagging subscribers to this area: @dotnet/ncl |
…x.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…x.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
src/libraries/Common/src/System/Net/Sockets/SocketErrorPal.Unix.cs
Outdated
Show resolved
Hide resolved
…x.cs Co-authored-by: Stephen Toub <stoub@microsoft.com>
|
/backport to release/10.0 |
|
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/18288262494 |
Context #120352 (comment)