Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Use ReadOnlySpan<byte> #219

Merged
merged 2 commits into from
Nov 15, 2019
Merged

Use ReadOnlySpan<byte> #219

merged 2 commits into from
Nov 15, 2019

Conversation

erikzhang
Copy link
Member

No description provided.


internal override ReadOnlyMemory<byte> ToMemory()
{
throw new NotSupportedException();
Copy link
Member

Choose a reason for hiding this comment

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

Implement it as virtual with this content by default in StackItem?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's internal. So it is the same anyway.


internal override ReadOnlyMemory<byte> ToMemory()
{
return value.IsZero ? ReadOnlyMemory<byte>.Empty : value.ToByteArray();
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should cache the ToByteArray the first time that will be used, what do you think?

Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

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

Maybe we should cache the ToByteArray the first time that will be used, what do you think?

But it's not related to this PR, so i approved

@erikzhang
Copy link
Member Author

We can do optimizations later.

@erikzhang erikzhang merged commit 104a39d into master Nov 15, 2019
@erikzhang erikzhang deleted the ReadOnlySpan branch November 15, 2019 03:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants