1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-05-03 04:22:20 +00:00
parent 4aa97ae698
commit c61af20411

View file

@ -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;
}
}