diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-03 04:22:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-03 04:22:20 +0000 |
commit | c61af2041178c9b0ccbf8c42fb89382d8ec9b411 (patch) | |
tree | c720f64be8498b907c8c127a4e0a17ca8d2356ff /win32/win32.c | |
parent | 4aa97ae698499039b5e3810d902fa936bdaa37d4 (diff) | |
download | ruby-c61af2041178c9b0ccbf8c42fb89382d8ec9b411.tar.gz |
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
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 5 |
1 files 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; } } |