-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
buffer: return fastbuffer directly instead of buffer.alloc(0) #60398
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
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:
|
c9737b3 to
e12c1a8
Compare
|
Perhaps you also want to replace |
|
Closed in favor of #60558 |
|
@gurgunday why not though? |
|
Didn't you see my comment?
|
|
@gurgunday I mean the thumbs down on
Which I interpreted as "No", but curious why (which is why I asked) |
|
Oh, sorry - I only saw one instance of that and it's allocated once during bootstrap |
|
Ah, the rest are in undici, where this wouldn't be possible directly, I see... |
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