node icon indicating copy to clipboard operation
node copied to clipboard

doc: added Buffer.from(string) to functions that use buffer pool

Open Whitecx opened this issue 1 year ago • 3 comments

Buffer.from(string) is one of the functions that may use the pre-allocated buffer. It's mentioned in the description of Buffer.from(array), but not in Buffer.from(string), or in the two other places where functions that behave this way are listed, so this commit adds those references.

Whitecx avatar May 02 '24 16:05 Whitecx

There appear to be a number of additional commits here that are unrelated to the doc change. Can I ask you to remove the extra commits?

jasnell avatar May 04 '24 15:05 jasnell

There appear to be a number of additional commits here that are unrelated to the doc change. Can I ask you to remove the extra commits?

Sorry about that, everything should be cleaned up now.

Whitecx avatar May 05 '24 21:05 Whitecx

@jasnell Does this change feel substantive? I wanted to make this PR when I had some time, because I'd used buffer.from(string) and was confused as to why the underlying buffer had other data in it. When I didn't see any explanation in the buffer.from(string) section of the docs, I actually went to the source code and found where the buffer pool was used when creating strings long before I noticed that this behavior was documented at the bottom of buffer.from(array) 😂.

It would've saved me some time had it been in the buffer.from(string) section of the docs, so I thought it might help others as well.

Whitecx avatar May 09 '24 12:05 Whitecx

If anyone has capacity to review this PR, I'd greatly appreciate it! If it doesn't seem worth including, I can certainly close it 🙂

Whitecx avatar May 19 '24 13:05 Whitecx

Oh, sorry for asking one more thing but can you please change the commit message to use add instead of added, is just for the commit message conventions.

H4ad avatar Jun 08 '24 23:06 H4ad

Oh, sorry for asking one more thing but can you please change the commit message to use add instead of added, is just for the commit message conventions.

No problem! I'll keep that in mind for future PRs 🙂

Whitecx avatar Jun 08 '24 23:06 Whitecx

Landed in ee8e84144a8cf521eb7829b3df1b3ceeabea9761

nodejs-github-bot avatar Jun 14 '24 12:06 nodejs-github-bot

@Whitecx congratulations on your first PR, thanks for contributing!

H4ad avatar Jun 14 '24 13:06 H4ad

@Whitecx congratulations on your first PR, thanks for contributing!

Thank you!! And thank you for supporting with your review 😊

Whitecx avatar Jun 14 '24 13:06 Whitecx