-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
doc: suggest Buffer.alloc instead of Buffer#fill #10000
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
doc: suggest Buffer.alloc instead of Buffer#fill #10000
Conversation
|
Congratulations for PR #10000, @not-an-aardvark ! |
19e6562 to
0010000
Compare
|
And there is also matching commit hash to commemorate the event 👍 |
Trott
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
jasnell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a nit
doc/api/buffer.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: long line here
0010000 to
ad6a645
Compare
|
Landed in ad6a645 |
Now that `Buffer.alloc` exists, there is no reason to recommend using `new Buffer(size).fill(0)` or `Buffer.allocUnsafe(size).fill(0)`. PR-URL: #10000 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Now that `Buffer.alloc` exists, there is no reason to recommend using `new Buffer(size).fill(0)` or `Buffer.allocUnsafe(size).fill(0)`. PR-URL: nodejs#10000 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Now that `Buffer.alloc` exists, there is no reason to recommend using `new Buffer(size).fill(0)` or `Buffer.allocUnsafe(size).fill(0)`. PR-URL: #10000 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Now that `Buffer.alloc` exists, there is no reason to recommend using `new Buffer(size).fill(0)` or `Buffer.allocUnsafe(size).fill(0)`. PR-URL: #10000 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
doc
Description of change
Now that
Buffer.allocexists, there is no reason to recommend usingnew Buffer(size).fill(0)orBuffer.allocUnsafe(size).fill(0).