Skip to content

Use u8 literals in ManagedTextSection.#86657

Merged
buyaa-n merged 1 commit intodotnet:mainfrom
teo-tsirpanis:srm-u8
May 27, 2023
Merged

Use u8 literals in ManagedTextSection.#86657
buyaa-n merged 1 commit intodotnet:mainfrom
teo-tsirpanis:srm-u8

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 area-System.Reflection.Metadata community-contribution Indicates that the PR has been added by a community member labels 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: -

}

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

Comments