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

perf: optimize consumeEnd #2510

Merged
merged 12 commits into from
Dec 9, 2023
Prev Previous commit
Next Next commit
Update lib/api/readable.js
Co-authored-by: Robert Nagy <ronagy@icloud.com>
  • Loading branch information
tsctx and ronag committed Dec 8, 2023
commit 5d874130d285414b0d8f18d401f42fa3276bf69d
4 changes: 2 additions & 2 deletions lib/api/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ function consumeStart (consume) {
*/
function chunksDecode (chunks, length) {
const buffer = Buffer.concat(chunks, length)
tsctx marked this conversation as resolved.
Show resolved Hide resolved
return buffer.toString(
'utf8',
return buffer.utf8Slice(
0,
buffer.length >= 3 &&
// Skip BOM.
buffer[0] === 0xef &&
Expand Down
Loading