Skip to content

Conversation

@cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Sep 9, 2018

When cloning binary metadata, use Buffer.from() instead of Buffer.prototype.slice(), as the latter creates a new Buffer that shares the same underlying bytes.

If a true clone is not needed, then the same Buffer instance should be returned, and I can update the test. Note that the existing test suite (minus the test added in this PR) passes with v.slice(), v, and Buffer.from(v).

When cloning binary metadata, use Buffer.from() instead of
Buffer.prototype.slice(), as the latter creates a new Buffer
that shares the same underlying bytes.
@murgatroid99 murgatroid99 merged commit 0de1f83 into grpc:master Sep 11, 2018
@cjihrig cjihrig deleted the metadata-clone branch September 11, 2018 18:35
@lock lock bot locked as resolved and limited conversation to collaborators Dec 10, 2018
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.

3 participants