[前][次][番号順一覧][スレッド一覧]

ruby-changes:51425

From: kazu <ko1@a...>
Date: Mon, 11 Jun 2018 23:14:02 +0900 (JST)
Subject: [ruby-changes:51425] kazu:r63631 (trunk): Use `&.` instead of modifier if and remove needless closed?

kazu	2018-06-11 23:13:56 +0900 (Mon, 11 Jun 2018)

  New Revision: 63631

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63631

  Log:
    Use `&.` instead of modifier if and remove needless closed?

  Modified files:
    trunk/test/test_tempfile.rb
Index: test/test_tempfile.rb
===================================================================
--- test/test_tempfile.rb	(revision 63630)
+++ test/test_tempfile.rb	(revision 63631)
@@ -361,7 +361,7 @@ puts Tempfile.new('foo').path https://github.com/ruby/ruby/blob/trunk/test/test_tempfile.rb#L361
     f.close
     assert_file.exist?(path)
   ensure
-    f.close if f && !f.closed?
+    f&.close
     File.unlink path if path
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]