Skip to content

Commit b4d9354

Browse files
committed
Use &. instead of modifier if
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 306e1e8 commit b4d9354

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/cgi/session.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ def restore
406406
@hash[CGI::unescape(k)] = Marshal.restore(CGI::unescape(v))
407407
end
408408
ensure
409-
f.close unless f.nil?
410-
lockf.close if lockf
409+
f&.close
410+
lockf&.close
411411
end
412412
end
413413
@hash
@@ -426,8 +426,8 @@ def update
426426
f.close
427427
File.rename @path+".new", @path
428428
ensure
429-
f.close if f
430-
lockf.close if lockf
429+
f&.close
430+
lockf&.close
431431
end
432432
end
433433

0 commit comments

Comments
 (0)