lib/rubocop/cop/style/ip_addresses.rb in rbhint-0.85.1.rc1 vs lib/rubocop/cop/style/ip_addresses.rb in rbhint-0.85.1.rc2
- old
+ new
@@ -32,10 +32,10 @@
# To try to avoid doing two regex checks on every string,
# shortcut out if the string does not look like an IP address
return false unless could_be_ip?(contents)
- contents =~ ::Resolv::IPv4::Regex || contents =~ ::Resolv::IPv6::Regex
+ ::Resolv::IPv4::Regex.match?(contents) || ::Resolv::IPv6::Regex.match?(contents)
end
# Dummy implementation of method in ConfigurableEnforcedStyle that is
# called from StringHelp.
def opposite_style_detected; end