-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Added support for passing Range
as a parameter to .Exclude
.
#619
Added support for passing Range
as a parameter to .Exclude
.
#619
Conversation
Range
as a parameter to .Exclude
.
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.
One thing I note in all three implementations is that they assume that !range.Start.IsFromEnd
and !range.End.IsFromEnd
.
Thankfully, Collection and List patterns are easy, because Index.GetOffset(int length)
exists specifically for this purpose. You can filter both range.Start
and range.End
through this method in the constructor before using them for the rest of the iterator.
For the Core
method, it will require some additional evaluation. You can review the Insert
for a glimpse at that pattern that will be required to handle it properly.
Still looking into this, just haven't had much time this week yet. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #619 +/- ##
==========================================
- Coverage 95.28% 95.27% -0.01%
==========================================
Files 248 248
Lines 8648 8701 +53
Branches 1592 1609 +17
==========================================
+ Hits 8240 8290 +50
- Misses 217 219 +2
- Partials 191 192 +1 ☔ View full report in Codecov by Sentry. |
I still need to add perf improvements and test coverage. |
Co-authored-by: Stuart Turner <stuart@turner-isageek.com>
I will have some time this weekend to work on this assuming I'm not still sick. I appreciate your patience with me and your assistance on it! |
# Conflicts: # Source/SuperLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt # Source/SuperLinq/PublicAPI/net7.0/PublicAPI.Unshipped.txt # Source/SuperLinq/PublicAPI/net8.0/PublicAPI.Unshipped.txt # Source/SuperLinq/PublicAPI/net9.0/PublicAPI.Unshipped.txt # Source/SuperLinq/PublicAPI/netcoreapp3.1/PublicAPI.Unshipped.txt
TL;DR
This PR resolves #10 by adding support for passing
Range
as a parameter to.Exclude
:The expected output for the above snippet is
1 - 5
followed by95 - 100
with each value on its own line.Format Adjustment
The existing ternary expressions for the
Count
properties did not match what was present in other methods in the file. As the other formats are generally cleaner I updated theCount
properties to break nesting out:Improved Documentation
Methods with access levels of
protected
or higher should have some form of documentation, even if their containing models areprivate
, simply for consumer understanding. As such, I added documentation to theCount
properties, and specified that documentation should be inherited fromIEnumerable<T>
where applicable.##Constructor Visibility
I marked the constructors for the
private
types asinternal
since by definition they'll never be consumed outside of the assembly.