mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use &.
instead of if
and ? :
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4992c02095
commit
5660bb929f
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue