提交 ed376985 编写于 作者: A Aaron Patterson

remove useless nil check

irb(main):004:0> /foo/ !~ nil
=> true
irb(main):005:0> /foo/ !~ 'bar'
=> true
irb(main):006:0> /foo/ !~ 'foo'
=> false
上级 3aabac5b
......@@ -99,7 +99,7 @@ def build_host_url(options)
end
def named_host?(host)
host && IP_HOST_REGEXP !~ host
IP_HOST_REGEXP !~ host
end
def normalize_protocol(protocol)
......@@ -116,7 +116,7 @@ def normalize_protocol(protocol)
end
def normalize_host(_host, options)
return _host if !named_host?(_host)
return _host unless named_host?(_host)
tld_length = options[:tld_length] || @@tld_length
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册