Skip to content

Use u8 literals in ManagedTextSection. - #86657

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

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

Conversation

@teo-tsirpanis

Copy link
Copy Markdown
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.

@ghostghost 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
Copy Markdown

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
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

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.

@buyaa-nbuyaa-n left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

The failures unrelated and known

@buyaa-n
buyaa-n merged commit b2edecd into dotnet:mainMay 27, 2023
@teo-tsirpanis
teo-tsirpanis deleted the srm-u8 branch May 27, 2023 00:14
@ghostghost locked as resolved and limited conversation to collaborators Jun 26, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Reflection.Metadatacommunity-contributionIndicates 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

@teo-tsirpanis@buyaa-n@danmoseley