From c61af2041178c9b0ccbf8c42fb89382d8ec9b411 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 3 May 2013 04:22:20 +0000 Subject: [PATCH] win32.c: optimization * win32/win32.c (poll_child_status): trivial optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/win32/win32.c b/win32/win32.c index 452883a770..71dbead1b0 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3928,17 +3928,16 @@ poll_child_status(struct ChildRecord *child, int *stat_loc) {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; } }