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

ruby-changes:51432

From: kazu <ko1@a...>
Date: Tue, 12 Jun 2018 23:36:36 +0900 (JST)
Subject: [ruby-changes:51432] kazu:r63638 (trunk): Use `&.` instead of modifier if

kazu	2018-06-12 23:36:30 +0900 (Tue, 12 Jun 2018)

  New Revision: 63638

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

  Log:
    Use `&.` instead of modifier if

  Modified files:
    trunk/test/test_pty.rb
Index: test/test_pty.rb
===================================================================
--- test/test_pty.rb	(revision 63637)
+++ test/test_pty.rb	(revision 63638)
@@ -18,8 +18,8 @@ class TestPTY < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_pty.rb#L18
   else
     assert_equal("a\r\n", r.gets)
   ensure
-    r.close if r
-    w.close if w
+    r&.close
+    w&.close
     Process.wait pid if pid
   end
 
@@ -239,4 +239,3 @@ class TestPTY < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_pty.rb#L239
     skip $!
   end
 end if defined? PTY
-

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

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