ipaddr icon indicating copy to clipboard operation
ipaddr copied to clipboard

==: Fix comparing '0.0.0.0'/'::' to nil

Open taketo1113 opened this issue 6 months ago • 0 comments

It fixes comparing '0.0.0.0'/'::' to nil for == method. IPAddr.new("0.0.0.0") == nil and nil == IPAddr.new("0.0.0.0") will return same result of false.

# IPv4
IPAddr.new("0.0.0.0") == nil
=> false

nil == IPAddr.new('0.0.0.0') 
=> false

IPAddr.new("0.0.0.0").nil?
=> false

# IPv6
IPAddr.new("::") == nil
=> false

nil == IPAddr.new("::")
=> false

IPAddr.new("::").nil?
=> false

Fix #75

taketo1113 avatar Aug 27 '24 13:08 taketo1113