Optimize iteration in SingleOrNothing with predicate.