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

ruby-changes:44800

From: kazu <ko1@a...>
Date: Tue, 22 Nov 2016 22:11:49 +0900 (JST)
Subject: [ruby-changes:44800] kazu:r56873 (trunk): Use `&.` instead of modifier if

kazu	2016-11-22 22:11:43 +0900 (Tue, 22 Nov 2016)

  New Revision: 56873

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

  Log:
    Use `&.` instead of modifier if

  Modified files:
    trunk/lib/resolv.rb
Index: lib/resolv.rb
===================================================================
--- lib/resolv.rb	(revision 56872)
+++ lib/resolv.rb	(revision 56873)
@@ -722,7 +722,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L722
       def close
         socks = @socks
         @socks = nil
-        socks.each(&:close) if socks
+        socks&.each(&:close)
       end
 
       class Sender # :nodoc:

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

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