Simplify AssemblyName.EscapeCodeBase and remove unsafe.#111095
Merged
steveharter merged 7 commits intodotnet:mainfrom Feb 12, 2025
Merged
Simplify AssemblyName.EscapeCodeBase and remove unsafe.#111095steveharter merged 7 commits intodotnet:mainfrom
AssemblyName.EscapeCodeBase and remove unsafe.#111095steveharter merged 7 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-reflection |
jkotas
reviewed
Jan 5, 2025
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Jan 5, 2025
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs
Outdated
Show resolved
Hide resolved
This was referenced Jan 6, 2025
jkotas
reviewed
Jan 6, 2025
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Jan 6, 2025
| } | ||
|
|
||
| i += (count - 1); | ||
| Debug.Assert(stringToEscape.EnumerateRunes() is { } e && e.MoveNext() && e.Current == r); |
Member
There was a problem hiding this comment.
What's the reason for needing this assert?
Contributor
Author
There was a problem hiding this comment.
I copied it from UriHelper.
stephentoub
reviewed
Jan 6, 2025
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs
Outdated
Show resolved
Hide resolved
steveharter
reviewed
Jan 13, 2025
src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs
Show resolved
Hide resolved
steveharter
approved these changes
Jan 13, 2025
Contributor
steveharter
left a comment
There was a problem hiding this comment.
LGTM; did a comparison to the original UriHelper
Contributor
|
@teo-tsirpanis is this ready for merge? |
Contributor
Author
|
@steveharter yes. |
Member
|
@steveharter can we merge it then? |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the implementation of
AssemblyName.EscapeCodeBaseto 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.Related to #94941.