summaryrefslogtreecommitdiff
path: root/lib/uri
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-22 23:44:51 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-22 23:44:51 +0000
commit5660bb929f6d9124cce46cd95f54fa0db30431ed (patch)
tree846f367aff7f055a133f09e1fbf399ba242fecb1 /lib/uri
parent4992c02095b53e69cceb925e1487e91228dd6972 (diff)
Use `&.` instead of `if` and `? :`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/uri')
-rw-r--r--lib/uri/generic.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/uri/generic.rb b/lib/uri/generic.rb
index 5df9a163fe..dcad27bc35 100644
--- a/lib/uri/generic.rb
+++ b/lib/uri/generic.rb
@@ -207,7 +207,7 @@ module URI
"the scheme #{@scheme} does not accept registry part: #{registry} (or bad hostname?)"
end
- @scheme.freeze if @scheme
+ @scheme&.freeze
self.set_path('') if !@path && !@opaque # (see RFC2396 Section 5.2)
self.set_port(self.default_port) if self.default_port && !@port
end
@@ -330,7 +330,7 @@ module URI
# see also URI::Generic.scheme=
#
def set_scheme(v)
- @scheme = v ? v.downcase : v
+ @scheme = v&.downcase
end
protected :set_scheme