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

ruby-changes:28513

From: nobu <ko1@a...>
Date: Fri, 3 May 2013 13:22:31 +0900 (JST)
Subject: [ruby-changes:28513] nobu:r40565 (trunk): win32.c: optimization

nobu	2013-05-03 13:22:20 +0900 (Fri, 03 May 2013)

  New Revision: 40565

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

  Log:
    win32.c: optimization
    
    * win32/win32.c (poll_child_status): trivial optimization.

  Modified files:
    trunk/win32/win32.c

Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 40564)
+++ win32/win32.c	(revision 40565)
@@ -3928,17 +3928,16 @@ poll_child_status(struct ChildRecord *ch https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L3928
 		    {STATUS_FLOAT_MULTIPLE_FAULTS,   SIGFPE},
 		    {STATUS_FLOAT_MULTIPLE_TRAPS,    SIGFPE},
 		    {STATUS_CONTROL_C_EXIT,          SIGINT},
-		    {0, 0}
 		};
 		int i;
-		for (i = 0; table[i].status; i++) {
+		for (i = 0; i < (int)numberof(table); i++) {
 		    if (table[i].status == exitcode) {
 			*stat_loc |= table[i].sig;
 			break;
 		    }
 		}
 		// if unknown status, assume SEGV
-		if (!table[i].status)
+		if (i >= (int)numberof(table))
 		    *stat_loc |= SIGSEGV;
 	    }
 	}

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

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