Skip to content

Conversation

yuyaryshev
Copy link
Contributor

Added join function defragments BufferList items into one big buffer.

Added join function defragments BufferList items into one big buffer.
Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

please add a unit test.
CI is failing

@rvagg
Copy link
Owner

rvagg commented Dec 7, 2020

OK, so this is essentially just a bare slice() where you're mutating an existing instance rather than returning a new one (or a Buffer). It feels a little like API fluff, although there is that minor difference in the mutation which is currently not possible.

What I'd like to know is what the use-case for this is? Why is fred.join() superior to fred = BufferList(fred.slice())? What are the scenarios where you want to keep a BufferList reference that's flattened internally and not just use a Buffer?

Needs linting, a test or three, and README.md additions.

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.

4 participants