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

Simplify ZipShortest implementation #904

Closed
wants to merge 1 commit into from
Closed

Simplify ZipShortest implementation #904

wants to merge 1 commit into from

Conversation

viceroypenguin
Copy link
Contributor

The various Zip* methods currently share implementation in .ZipImpl(). However, the code is simpler for each one when they are written separately; that is, in this case, the variances are more than the commonality. As such, we should allow each method to be implemented separately.

This PR updates the implementation of ZipShortest to be done separately from .ZipImpl().

@codecov
Copy link

codecov bot commented Nov 26, 2022

Codecov Report

Merging #904 (13d4bc7) into master (9ef27ea) will increase coverage by 0.09%.
The diff coverage is 95.65%.

@@            Coverage Diff             @@
##           master     #904      +/-   ##
==========================================
+ Coverage   92.38%   92.48%   +0.09%     
==========================================
  Files         110      110              
  Lines        3442     3460      +18     
  Branches     1021     1025       +4     
==========================================
+ Hits         3180     3200      +20     
+ Misses        200      198       -2     
  Partials       62       62              
Impacted Files Coverage Δ
MoreLinq/ZipShortest.cs 95.23% <95.65%> (+11.90%) ⬆️

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

@atifaziz
Copy link
Member

Possibly a duplicate of PR #715 by @Orace?

@viceroypenguin
Copy link
Contributor Author

Duplicate in the sense that both separate the implementations of the three zip functions, yes. However, #715 uses T4 to generate separate implementations of each method for argument count 2-4. #715 and #904 have essentially the same implementation, with some variances on how the implementation is written.

@viceroypenguin
Copy link
Contributor Author

Closing in favor of PR #715.

@viceroypenguin viceroypenguin deleted the zipshortest-implementation branch January 27, 2023 12:18
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.

2 participants