-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Simplify AssemblyName.EscapeCodeBase
and remove unsafe
.
#111095
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @dotnet/area-system-reflection |
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs
Outdated
Show resolved
Hide resolved
|
||
i += (count - 1); | ||
Debug.Assert(stringToEscape.EnumerateRunes() is { } e && e.MoveNext() && e.Current == r); |
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.
What's the reason for needing this assert?
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.
I copied it from UriHelper
.
Debug.Assert(stringToEscape.EnumerateRunes() is { } e && e.MoveNext() && e.Current == r); |
This PR updates the implementation of
AssemblyName.EscapeCodeBase
to match the current implementation ofUriHelper.EscapeString
, after simplifying it to remove unneeded capabilities. As a result, the code has become simpler, more efficient, and no longerunsafe
.