Skip to content

Commit d1d6a2a

Browse files
committed
c/nondominated.h (find_nondominated_set_agree_): Slight simplification.
1 parent a8255c4 commit d1d6a2a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

c/nondominated.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -410,17 +410,15 @@ find_nondominated_set_agree_(const double * restrict points, dimension_t dim, si
410410

411411
assert(dom_k ^ dom_j); // At least one but not both can be removed.
412412

413-
if (unlikely(nondom == NULL)) {
414-
return dom_k ? k : j;
415-
}
416-
if (dom_j) {
417-
assert(nondom[j]);
418-
nondom[j] = false;
419-
new_size--;
413+
size_t last_dom_pos = dom_j ? j : k;
414+
if (unlikely(nondom == NULL))
415+
return last_dom_pos;
416+
417+
new_size--; // Something dominated.
418+
assert(nondom[last_dom_pos]);
419+
nondom[last_dom_pos] = false;
420+
if (dom_j)
420421
break;
421-
}
422-
nondom[k] = false;
423-
new_size--;
424422
}
425423
}
426424
return new_size;

0 commit comments

Comments
 (0)