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

correct the wrong comment for encodeZigZag #2072

Closed
wants to merge 1 commit into from

Conversation

faithk7
Copy link
Contributor

@faithk7 faithk7 commented Sep 21, 2023

The comment for encodeZigZag(x) is wrong.

Should be encodeZigZag(x) == -2*x - 1, as

encodeZigZag(-1) = 1

and

encodeZigZag(-2) = 3

Closes #2046

@facebook-github-bot
Copy link
Contributor

@yfeldblum has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@yfeldblum merged this pull request in b198808.

facebook-github-bot pushed a commit to facebook/hhvm that referenced this pull request Jun 21, 2024
Summary:
The comment for encodeZigZag(x) is wrong.

Should be encodeZigZag(x) == -2*x - 1, as

encodeZigZag(-1) = 1

and

encodeZigZag(-2) = 3

Closes facebook/folly#2046

X-link: facebook/folly#2072

Reviewed By: Gownta

Differential Revision: D58789263

Pulled By: yfeldblum

fbshipit-source-id: af4d16b606cdc39ec930f16218ebf53637a86815
@yfeldblum yfeldblum mentioned this pull request Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

comment about encodeZigZag in Varint.h is wrong.
2 participants