- while ((found = MSG_comm_testany(globals->isends)) != -1) {
- xbt_dynar_remove_at(globals->isends, found, &comm);
+ while (true) {
+ int pos_found = MSG_comm_testany(globals->isends);
+ if (pos_found == -1) /* none remaining */
+ break;
+ xbt_dynar_remove_at(globals->isends, pos_found, &comm);