Skip to content

Commit

Permalink
Rubocop: Fix Lint/AmbiguousOperatorPrecedence
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Sep 15, 2022
1 parent 3c0e8ca commit 4402d84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/smart_proxy_dhcp_infoblox/ip_address_arithmetic.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module ::Proxy::DHCP::Infoblox
module IpAddressArithmetic
def cidr_to_ip_mask(prefix_length)
bitmask = 0xFFFFFFFF ^ (2**(32 - prefix_length) - 1)
(0..3).map { |i| (bitmask >> i * 8) & 0xFF }.reverse.join('.')
bitmask = 0xFFFFFFFF ^ ((2**(32 - prefix_length)) - 1)
(0..3).map { |i| (bitmask >> (i * 8)) & 0xFF }.reverse.join('.')
end

def ipv4_to_i(an_address)
Expand All @@ -14,7 +14,7 @@ def i_to_ipv4(i) # rubocop:todo Naming/MethodParameterName
end

def cidr_to_bitmask(prefix_length)
0xFFFFFFFF ^ (2**(32 - prefix_length) - 1)
0xFFFFFFFF ^ ((2**(32 - prefix_length)) - 1)
end

def cidr_to_i(an_address_with_cidr)
Expand Down

0 comments on commit 4402d84

Please sign in to comment.