-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce minOf() on KtIterable #171
Conversation
Codecov Report
@@ Coverage Diff @@
## master #171 +/- ##
=======================================
Coverage 99.21% 99.21%
=======================================
Files 39 39
Lines 1774 1781 +7
=======================================
+ Hits 1760 1767 +7
Misses 14 14
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
/// Returns the smallest value among all values produced by selector function applied to each element in the array. | ||
/// | ||
/// Throws a [NoSuchElementException] if the list is empty. | ||
R minOf<R extends Comparable>(R Function(T) selector) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the selector
be optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, kotlins selector is required, too
Closes #157 by adding minOf() method on KtIterable.
Kotlin does not allow to omit the selector function (see example)
If wanted other functions could be checked too to let it be omitted if possible.