minByKey<U extends Comparable<U> > method
Returns the element that gives the minimum value from the specified function.
Implementation
@override
Option<T> minByKey<U extends Comparable<U>>(U Function(T) f) {
T min;
U minVal;
if (moveNext()) {
min = current;
minVal = f(min);
} else {
return None;
}
for (final element in this) {
final val = f(element);
if (val.compareTo(minVal) < 0) {
min = element;
minVal = val;
}
}
return Some(min);
}