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

ruby-changes:38705

From: normal <ko1@a...>
Date: Sat, 6 Jun 2015 07:22:07 +0900 (JST)
Subject: [ruby-changes:38705] normal:r50786 (trunk): * ext/socket/ancdata.c (bsock_sendmsg_internal): drop redundant assignment

normal	2015-06-06 07:21:47 +0900 (Sat, 06 Jun 2015)

  New Revision: 50786

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

  Log:
    * ext/socket/ancdata.c (bsock_sendmsg_internal): drop redundant assignment
    
    We call memset to zero `mh' a few lines above anyways, making
    explicitly zero-ing each field unnecessary.
    
    Compilers optimize this code away anyways, but it still costs me
    4 lines of my small terminal and even smaller attention span.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/ancdata.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50785)
+++ ChangeLog	(revision 50786)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jun  6 07:08:45 2015  Eric Wong  <e@8...>
+
+	* ext/socket/ancdata.c (bsock_sendmsg_internal): drop redundant assignment
+
 Sat Jun  6 01:00:06 2015  Naohisa Goto  <ngotogenome@g...>
 
 	* ext/socket/ancdata.c (bsock_sendmsg_internal): all arguments are
Index: ext/socket/ancdata.c
===================================================================
--- ext/socket/ancdata.c	(revision 50785)
+++ ext/socket/ancdata.c	(revision 50786)
@@ -1268,10 +1268,6 @@ bsock_sendmsg_internal(int argc, VALUE * https://github.com/ruby/ruby/blob/trunk/ext/socket/ancdata.c#L1268
         mh.msg_control = RSTRING_PTR(controls_str);
         mh.msg_controllen = RSTRING_SOCKLEN(controls_str);
     }
-    else {
-        mh.msg_control = NULL;
-        mh.msg_controllen = 0;
-    }
 #endif
 
     rb_io_check_closed(fptr);

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

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