Skip to content
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

Use u8 literals in ManagedTextSection. #86657

Merged
merged 1 commit into from
May 27, 2023
Merged

Conversation

teo-tsirpanis
Copy link
Contributor

Instead of iterating the characters of a string, casting them into bytes and writing them, we use u8 literals and directly write the UTF-8 span of them.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label May 23, 2023
@ghost
Copy link

ghost commented May 23, 2023

Tagging subscribers to this area: @dotnet/area-system-reflection-metadata
See info in area-owners.md if you want to be subscribed.

Issue Details

Instead of iterating the characters of a string, casting them into bytes and writing them, we use u8 literals and directly write the UTF-8 span of them.

Author: teo-tsirpanis
Assignees: -
Labels:

area-System.Reflection.Metadata, community-contribution

Milestone: -

@@ -788,7 +788,7 @@ public void WriteBytes(byte[] buffer, int start, int byteCount)
WriteBytes(buffer.AsSpan(start, byteCount));
}

private void WriteBytes(ReadOnlySpan<byte> buffer)
internal void WriteBytes(ReadOnlySpan<byte> buffer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move below public methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to not move it to minimize changes. It will become public with #85280 either way.

Copy link
Contributor

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@buyaa-n
Copy link
Contributor

buyaa-n commented May 27, 2023

The failures unrelated and known

@buyaa-n buyaa-n merged commit b2edecd into dotnet:main May 27, 2023
@teo-tsirpanis teo-tsirpanis deleted the srm-u8 branch May 27, 2023 00:14
@ghost ghost locked as resolved and limited conversation to collaborators Jun 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Reflection.Metadata community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants