-
Notifications
You must be signed in to change notification settings - Fork 418
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 Fold
Implementation
#961
Conversation
Codecov Report
@@ Coverage Diff @@
## master #961 +/- ##
==========================================
+ Coverage 92.49% 92.59% +0.10%
==========================================
Files 113 113
Lines 3424 3432 +8
Branches 1024 1049 +25
==========================================
+ Hits 3167 3178 +11
+ Misses 192 191 -1
+ Partials 65 63 -2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments other looks good to merge, thanks!
This reverts commit 5011761.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR simplifies the implementation of
Fold
. The existingFoldImpl
is unnecessary and onerous to maintain. Since it receives 18 arguments, it must check which one should be non-null
and then it must select that one forFold
ing. This a) creates additional branches and code bloat, and b) adds an additional method that must be maintained.It is better to have each overload of
Fold
do what it needs to do directly. This avoids branching and theAssume.NotNull()
check, and simplifies the code significantly.