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

internal/math: fix a corner case for IsPowerOfTwo #476

Merged
merged 1 commit into from
Jun 9, 2023
Merged

internal/math: fix a corner case for IsPowerOfTwo #476

merged 1 commit into from
Jun 9, 2023

Conversation

callthingsoff
Copy link
Contributor

In the current implementation, if n == 0, the result is true which is incorrect.

In the current implementation, if n == 0, the result is true which is incorrect.
Copy link
Owner

@panjf2000 panjf2000 left a comment

Choose a reason for hiding this comment

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

LGTM

@panjf2000 panjf2000 changed the title internal/math: correct IsPowerOfTwo internal/math: fix the corner case for IsPowerOfTwo Jun 9, 2023
@panjf2000 panjf2000 changed the title internal/math: fix the corner case for IsPowerOfTwo internal/math: fix a corner case for IsPowerOfTwo Jun 9, 2023
@panjf2000 panjf2000 added enhancement New feature or request pending merged This PR has been reviewed and approved optimization Some small optimizations working on it chores labels Jun 9, 2023
@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (f55fbde) 77.01% compared to head (3c6c563) 77.01%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #476   +/-   ##
=======================================
  Coverage   77.01%   77.01%           
=======================================
  Files          23       23           
  Lines        2449     2449           
=======================================
  Hits         1886     1886           
  Misses        429      429           
  Partials      134      134           
Flag Coverage Δ
unittests 77.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@panjf2000 panjf2000 merged commit 6136138 into panjf2000:dev Jun 9, 2023
53 checks passed
@callthingsoff callthingsoff deleted the fix_math branch June 9, 2023 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chores enhancement New feature or request optimization Some small optimizations pending merged This PR has been reviewed and approved working on it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants