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

Add Minima & Maxima as successors to MinBy & MaxBy #1019

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

atifaziz
Copy link
Member

@atifaziz atifaziz commented Oct 23, 2023

This PR closes #1018.

It introduces Minima as a replacement for MinBy and Maxima as a replacement for MaxBy.

MinBy and MaxBy are still there for compatibility, but marked obsolete. In .NET 6+, they are demoted from being extension methods to regular static ones, which should avoid conflicts with identically named methods introduced with .NET 6. Both methods are, however, exposed as extensions when statically imported via MoreEnumerable.Extensions.MinByExtension and MoreEnumerable.Extensions.MaxByExtension. These can conflict when a project migrates to .NET 6, but that would have happened anyway. These extensions are also marked as being superseded by their successors and so the developer should be guided to make the required change by using either MoreEnumerable.Extensions.MinimaExtension/MoreEnumerable.Extensions.MaximaExtension or simply reverting to importing MoreLinq.

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #1019 (ae78e1e) into master (dd8e8a8) will not change coverage.
The diff coverage is 93.96%.

❗ Current head ae78e1e differs from pull request most recent head 3060351. Consider uploading reports for the commit 3060351 to get more accurate results

@@           Coverage Diff           @@
##           master    #1019   +/-   ##
=======================================
  Coverage   92.63%   92.63%           
=======================================
  Files         113      113           
  Lines        3421     3421           
  Branches     1056     1056           
=======================================
  Hits         3169     3169           
  Misses        189      189           
  Partials       63       63           
Files Coverage Δ
MoreLinq/Minima.cs 100.00% <100.00%> (ø)
MoreLinq/Maxima.cs 93.45% <93.45%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@atifaziz atifaziz merged commit 66f7cab into morelinq:master Oct 24, 2023
@atifaziz atifaziz deleted the extrema branch October 24, 2023 06:26
julienasp pushed a commit to julienasp/MoreLINQ that referenced this pull request Nov 14, 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.

Add Minima & Maxima to supersede MinBy & MaxBy
2 participants