Skip to content

Commit

Permalink
Merge pull request #940 from cucumber/fix-rubocop-offense
Browse files Browse the repository at this point in the history
Fix Style/BitwisePredicate RuboCop offense
  • Loading branch information
mvz authored Nov 10, 2024
2 parents d98df76 + 21c6f2e commit e1673f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/aruba/contracts/is_power_of_two.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class IsPowerOfTwo
def self.valid?(value)
# explanation for algorithm can be found here:
# http://www.exploringbinary.com/ten-ways-to-check-if-an-integer-is-a-power-of-two-in-c/
value.positive? && (value & (value - 1)).zero?
value.positive? && value.nobits?(value - 1)
rescue StandardError
false
end
Expand Down

0 comments on commit e1673f5

Please sign in to comment.