Skip to content
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: fix buf.readInt16LE output #5282

Closed
wants to merge 1 commit into from
Closed

doc: fix buf.readInt16LE output #5282

wants to merge 1 commit into from

Conversation

chinedufn
Copy link
Contributor

No description provided.

Previous example didn't account for the 1 byte offset
@@ -728,7 +728,7 @@ const buf = new Buffer([1,-2,3,4]);
buf.readInt16BE();
// returns 510
buf.readInt16LE(1);
// returns -511
// returns 1022
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original intent was to read the same two bytes.
cc @jasnell who I believe added this example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Will update to whatever @jasnell thinks here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this was a typo on my part... the second one should be buf.readInt16LE(); (no argument passed in)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that said, this change works too

@mscdex mscdex added buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations. labels Feb 17, 2016
@jasnell
Copy link
Member

jasnell commented Feb 19, 2016

LGTM

@silverwind
Copy link
Contributor

LGTM, landed in 8b1af2f.

@silverwind silverwind closed this Feb 25, 2016
silverwind pushed a commit that referenced this pull request Feb 25, 2016
Previous example didn't account for the 1 byte offset

PR-URL: #5282
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
rvagg pushed a commit that referenced this pull request Feb 27, 2016
Previous example didn't account for the 1 byte offset

PR-URL: #5282
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
rvagg pushed a commit that referenced this pull request Feb 27, 2016
Previous example didn't account for the 1 byte offset

PR-URL: #5282
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
@Fishrock123 Fishrock123 mentioned this pull request Mar 1, 2016
5 tasks
MylesBorins pushed a commit that referenced this pull request Mar 17, 2016
Previous example didn't account for the 1 byte offset

PR-URL: #5282
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
MylesBorins pushed a commit that referenced this pull request Mar 21, 2016
Previous example didn't account for the 1 byte offset

PR-URL: #5282
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants