- for (i=0; i<hd->portLen; i++) {
- if (hd->port2chan[ i ] == pd->chan) {
- memmove(&(hd->port[i]), &(hd->port[i+1]), (hd->portLen -i -1) * sizeof(int));
- memmove(&(hd->port2chan[i]), &(hd->port2chan[i+1]), (hd->portLen -i -1) * sizeof(int));
- hd->portLen--;
- i--; /* counter the effect of the i++ at the end of the iteration */
+ xbt_dynar_foreach(hd->ports, cpt, pr) {
+ if (pr.port == trp_pd->chan || pr.port == trp_pd->rawChan) {
+ xbt_dynar_cursor_rm(hd->ports, &cpt);