ruby-changes:46205
From: normal <ko1@a...>
Date: Tue, 11 Apr 2017 23:56:22 +0900 (JST)
Subject: [ruby-changes:46205] normal:r58320 (trunk): Socket.udp_server_sockets: use symbol proc
normal 2017-04-11 23:56:17 +0900 (Tue, 11 Apr 2017) New Revision: 58320 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58320 Log: Socket.udp_server_sockets: use symbol proc Symbol proc is shorter human and machine code; and also avoids needing to name variables. * ext/socket/lib/socket.rb (Socket.udp_server_sockets): use symbol proc Modified files: trunk/ext/socket/lib/socket.rb Index: ext/socket/lib/socket.rb =================================================================== --- ext/socket/lib/socket.rb (revision 58319) +++ ext/socket/lib/socket.rb (revision 58320) @@ -897,7 +897,7 @@ class Socket < BasicSocket https://github.com/ruby/ruby/blob/trunk/ext/socket/lib/socket.rb#L897 ip_list << ai end } - ip_list.uniq!{|e| e.to_sockaddr} + ip_list.uniq!(&:to_sockaddr) if port == 0 sockets = ip_sockets_port0(ip_list, false) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/