minBy<R extends Comparable<R>> method Null safety

T minBy<R extends Comparable<R>>(
  1. R by(
    1. T item
    ),
  2. [T? ifNull]
)

Implementation

T minBy<R extends Comparable<R>>(R by(T item), [T? ifNull]) {
  return minByOrNull(by, ifNull) ??
      (throw IndexError(0, this, "minBy while empty"));
}