Skip to content
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

Merged
merged 4 commits into from
Oct 14, 2021

Conversation

robiness
Copy link
Contributor

@robiness robiness commented Oct 14, 2021

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.

@codecov
Copy link

codecov bot commented Oct 14, 2021

Codecov Report

Merging #171 (f5a891c) into master (fa04572) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #171   +/-   ##
=======================================
  Coverage   99.21%   99.21%           
=======================================
  Files          39       39           
  Lines        1774     1781    +7     
=======================================
+ Hits         1760     1767    +7     
  Misses         14       14           
Flag Coverage Δ
unittests 99.21% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/src/collection/kt_iterable.dart 99.46% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa04572...f5a891c. Read the comment docs.

/// 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) {
Copy link
Owner

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?

Copy link
Owner

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

@passsy
Copy link
Owner

passsy commented Oct 14, 2021

@passsy passsy merged commit 53047b0 into passsy:master Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add minOf()
2 participants