Closed skarllot closed 7 months ago
Merging #1033 (b000e92) into master (092a40d) will increase coverage by
0.04%
. The diff coverage is100.00%
.:exclamation: Current head b000e92 differs from pull request most recent head b81272e. Consider uploading reports for the commit b81272e to get more accurate results
@@ Coverage Diff @@
## master #1033 +/- ##
==========================================
+ Coverage 92.62% 92.67% +0.04%
==========================================
Files 113 114 +1
Lines 3419 3442 +23
Branches 1055 1060 +5
==========================================
+ Hits 3167 3190 +23
Misses 189 189
Partials 63 63
Files | Coverage Δ | |
---|---|---|
MoreLinq/AggregateOrDefault.cs | 100.00% <100.00%> (ø) |
:mega: Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!
@atifaziz yes, you are right. The only difference that I can see is less allocation (do not create DefaultIfEmptyIterator
instance).
The only difference that I can see is less allocation (do not create
DefaultIfEmptyIterator
instance).
That's true, but it's going to be hard to avoid that with most LINQ compositions/chains that run deeper than a single call. With every addition to the project, one has to weigh the cost of maintaining the code, documentation and tests (often long after the original contributor may have moved on) and I find that this one isn't worth it on the count of avoiding one allocation. I wish you had opened an issue to declare your intent to add this so I could've avoided you the trouble of going through the effort of coding, testing and submitting a PR in the first place. I will close this now, but I hope this does not discourage you from contributing in the future especially because (and for what it's worth stating) this was a good quality PR.
No problem. I thought to open a issue before, but I could use this PR as training to understand this project particularities for future contributions.
Add the extension method
AggregateOrDefault
allowing to aggregate over empty collections by returning a default value.