def first_cand
import unified-nsga-iii@0.2.2.0/survival.bend as Survivalimport Base
494# First remaining last-front index. Used when inNiche is empty
495# (C# would throw; never pick a phantom combined-pool index 0).
496def first_cand(cand: List<&2, Nat>) -> Nat:
497 match cand:
498 case Nil{}:
499 0n
500 case x <> _:
501 x