max<U extends num> method

U? max<U extends num>(
  1. TFuncMapper<T, U> funcMapper
)

Implementation

U? max<U extends num>(TFuncMapper<T, U> funcMapper) {
	U? curMax;
	for (T? item in this) {
		if (item == null) {
			continue;
		}

		U value = funcMapper(item);
		if (curMax == null) {
			curMax = value;
			continue;
		}

		if (value > curMax) {
			curMax = value;
		}
	}

	return curMax;
}