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

Implemented AsSpan on NetMQFrame #1069

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Implemented AsSpan on NetMQFrame #1069

merged 1 commit into from
Aug 7, 2023

Conversation

dxdjgl
Copy link
Contributor

@dxdjgl dxdjgl commented Jul 23, 2023

No description provided.

Copy link
Member

@drewnoakes drewnoakes left a comment

Choose a reason for hiding this comment

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

Great idea, thanks.

/// <returns>the Buffer as a readonly span</returns>
public ReadOnlySpan<byte> ToReadOnlySpan()
{
return new 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.

This should take the message length into account. The buffer could be longer than the message.

/// Return an readonly span of bytes that carries the content of this NetMQFrames Buffer.
/// </summary>
/// <returns>the Buffer as a readonly span</returns>
public ReadOnlySpan<byte> ToReadOnlySpan()
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about calling this AsSpan, to match similar methods names in the BCL, such as on strings?

@dxdjgl
Copy link
Contributor Author

dxdjgl commented Jul 24, 2023

You are absolutely right, review comments has been fixed. However coverage seems to hanging, and unit test failure seems to be a timing dependent test which fails from time to time.

@dxdjgl dxdjgl changed the title Implemented ToReadOnlySpan on NetMQFrame Implemented AsSpan on NetMQFrame Jul 24, 2023
@dxdjgl
Copy link
Contributor Author

dxdjgl commented Jul 26, 2023

@drewnoakes would you take another look at the code and let me know if other changes are needed.

Copy link
Member

@drewnoakes drewnoakes left a comment

Choose a reason for hiding this comment

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

Apologies for the delay here. Looks great to me.

@drewnoakes drewnoakes merged commit 41a940c into zeromq:master Aug 7, 2023
2 checks passed
@drewnoakes
Copy link
Member

@dxdjgl
Copy link
Contributor Author

dxdjgl commented Aug 7, 2023

Thanks Drew for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants