Skip to content

Simplify ZipShortest implementation - #904

Closed
viceroypenguin wants to merge 1 commit into
morelinq:masterfrom
viceroypenguin:zipshortest-implementation
Closed

Simplify ZipShortest implementation#904
viceroypenguin wants to merge 1 commit into
morelinq:masterfrom
viceroypenguin:zipshortest-implementation

Conversation

@viceroypenguin

Copy link
Copy Markdown
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

codecov Bot commented Nov 26, 2022

Copy link
Copy Markdown

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
Copy Markdown
Member

Possibly a duplicate of PR #715 by @Orace?

@viceroypenguin

Copy link
Copy Markdown
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
Copy Markdown
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