-
Notifications
You must be signed in to change notification settings - Fork 743
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea, thanks.
src/NetMQ/NetMQFrame.cs
Outdated
/// <returns>the Buffer as a readonly span</returns> | ||
public ReadOnlySpan<byte> ToReadOnlySpan() | ||
{ | ||
return new ReadOnlySpan<byte>(Buffer); |
There was a problem hiding this comment.
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.
src/NetMQ/NetMQFrame.cs
Outdated
/// 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() |
There was a problem hiding this comment.
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?
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. |
@drewnoakes would you take another look at the code and let me know if other changes are needed. |
There was a problem hiding this 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.
Thanks Drew for your help |
No description provided.