dgram: use Buffer.alloc(0) for zero-size buffers#8751
Closed
Conversation
There is no difference between alloc(0) and allocUnsafe(0), so there is no reason to confuse anyone reading the code with an additional call to allocUnsafe.
cjihrig
approved these changes
Sep 25, 2016
lpinca
approved these changes
Sep 28, 2016
Member
|
LGTM |
jasnell
pushed a commit
that referenced
this pull request
Oct 6, 2016
There is no difference between alloc(0) and allocUnsafe(0), so there is no reason to confuse anyone reading the code with an additional call to allocUnsafe. PR-URL: #8751 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Member
|
Landed in 0f944ab. Thank you! |
Contributor
|
lts? |
Member
|
Yes, pulling this back makes sense. |
jasnell
pushed a commit
that referenced
this pull request
Oct 10, 2016
There is no difference between alloc(0) and allocUnsafe(0), so there is no reason to confuse anyone reading the code with an additional call to allocUnsafe. PR-URL: #8751 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Fishrock123
pushed a commit
that referenced
this pull request
Oct 11, 2016
There is no difference between alloc(0) and allocUnsafe(0), so there is no reason to confuse anyone reading the code with an additional call to allocUnsafe. PR-URL: #8751 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Contributor
|
@ChALkeR this is not landing cleanly on v4.x, would you be willing to manually backport? |
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.
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
dgram
Description of change
There is no difference between
Buffer.alloc(0)andBuffer.allocUnsafe(0), so there is no reason to confuse anyone reading the code with an additional call toallocUnsafe./cc @jasnell @addaleax
Upd: ow, I created a branch on this repo, will delete it after this merges.