Skip to content

Added Iterable<Comparable> Extensions: .min and .max #51555

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

Closed

Conversation

ChristianKleineidam
Copy link

I created .min and .max Iterable extensions. I used the fact that NaN != NaN to make the functions return the same results as the existing min() and max() functions.

See previous discussion at #42000 and #41902

I added .min and max as Iterable<Comparable> extensions. I implemented them to behave the same way with NaN as the current min() and max() functions behave by using the fact that NaN != NaN.
@copybara-service
Copy link

Thank you for your contribution. This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/285705

Please wait for a developer to review your code review at the above link. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly. You can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code and they will help you. You can also push additional commits to this pull request to update the code review.

@copybara-service
Copy link

Thank you for your contribution. This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/285940

Please wait for a developer to review your code review at the above link. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly. You can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code and they will help you. You can also push additional commits to this pull request to update the code review.

@kevmoo
Copy link
Member

kevmoo commented Feb 28, 2023

@devoncarew @natebosch @lrhn – are we keeping these in pkg:collection – I could go either way here.

CC @mit-mit too

@natebosch
Copy link
Member

Thanks for the PR.
I think we should keep these in package:collection.

https://pub.dev/documentation/collection/latest/collection/IterableComparableExtension.html

@natebosch natebosch closed this Mar 1, 2023
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.

3 participants