-
Notifications
You must be signed in to change notification settings - Fork 603
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
Fix an issue in Chunk#toBytes
#943
Fix an issue in Chunk#toBytes
#943
Conversation
…en a Chunk.Bytes has a length less than the backing array
Hi @adamretter, thanks for sending this in. I'll investigate some more to see if we can keep this optimisation without compromising |
I think we can keep this optimisation by having the @mpilquist WDYT? EDIT: Alternatively, we could simply modify |
Hm, I think this is okay as-is. The Note that |
Right, so Should we change |
Yeah, let's fix I think I know how this bug was introduced in 0.10. Early in the 0.10 work, |
I'll send a PR in asap |
Thanks a lot @adamretter for spotting this! Closing :) |
Fixes an issue where too many bytes are returned from
Chunk#toBytes
, when aChunk.Bytes
has alength
less than the backing array.This may not be the most elegant, efficient or even correct way to fix this, but it certainly causes the test case that I have added to pass, where it previously failed.