buffer: return fastbuffer directly instead of buffer.alloc(0)#60398
Closed
gurgunday wants to merge 1 commit intonodejs:mainfrom
Closed
buffer: return fastbuffer directly instead of buffer.alloc(0)#60398gurgunday wants to merge 1 commit intonodejs:mainfrom
gurgunday wants to merge 1 commit intonodejs:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60398 +/- ##
==========================================
- Coverage 88.58% 88.58% -0.01%
==========================================
Files 704 704
Lines 207815 207815
Branches 40036 40041 +5
==========================================
- Hits 184102 184083 -19
- Misses 15758 15770 +12
- Partials 7955 7962 +7
🚀 New features to boost your workflow:
|
lpinca
approved these changes
Oct 25, 2025
ChALkeR
approved these changes
Oct 27, 2025
c9737b3 to
e12c1a8
Compare
Member
|
Perhaps you also want to replace |
Member
Author
|
Closed in favor of #60558 |
Member
|
@gurgunday why not though? |
Member
Author
|
Didn't you see my comment?
|
Member
|
@gurgunday I mean the thumbs down on
Which I interpreted as "No", but curious why (which is why I asked) |
Member
Author
|
Oh, sorry - I only saw one instance of that and it's allocated once during bootstrap |
Member
|
Ah, the rest are in undici, where this wouldn't be possible directly, I see... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As in other places here, we don't need to call
Buffer.alloc(0), which validates the length and calls FastBuffer anywayThis bypasses the validation logic and is consequently faster