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

Don't copy chunks if they're already buffers #154

Merged
merged 1 commit into from Mar 13, 2019

Conversation

zbjornson
Copy link
Contributor

Buffer.from(buffer) copies the buffer, which seems unnecessary. What do you think?

@dougwilson dougwilson self-assigned this Mar 12, 2019
@dougwilson dougwilson added the pr label Mar 12, 2019
@dougwilson
Copy link
Contributor

Indeed, it does copy the underlying data into a new buffer, which is definitely unnecessary. This looks good, and I'll get this merged tomorrow with your other PR 🎉

Copy link
Contributor

@dougwilson dougwilson left a comment

Choose a reason for hiding this comment

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

I hope you don't mind, but I added a function to reduce the line length since I was rebasing the PR anyhow.

@zbjornson
Copy link
Contributor Author

Not at all! :) Thanks

@dougwilson dougwilson merged commit 7e91b18 into expressjs:master Mar 13, 2019
AnkushLambdatest pushed a commit to AnkushLambdatest/compression that referenced this pull request Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants