summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-04 13:30:25 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-04 13:30:25 +0000
commitb4d935455f585d50ceff259efe6ed746b4a1a997 (patch)
tree5d431d5f9e92acfbb6d7511b087c2efb150b34ed /lib
parent306e1e81634c7f5db2354706b1930025e828125c (diff)
Use `&.` instead of modifier if
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/cgi/session.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/cgi/session.rb b/lib/cgi/session.rb
index fbb42986a4..5afc7e69aa 100644
--- a/lib/cgi/session.rb
+++ b/lib/cgi/session.rb
@@ -406,8 +406,8 @@ class CGI
@hash[CGI::unescape(k)] = Marshal.restore(CGI::unescape(v))
end
ensure
- f.close unless f.nil?
- lockf.close if lockf
+ f&.close
+ lockf&.close
end
end
@hash
@@ -426,8 +426,8 @@ class CGI
f.close
File.rename @path+".new", @path
ensure
- f.close if f
- lockf.close if lockf
+ f&.close
+ lockf&.close
end
end