Skip to content

Collection range indices - #94

Merged
feO2x merged 5 commits into
devfrom
features/93-collection-range-indices
Oct 9, 2023
Merged

feO2x merged 5 commits into
devfrom
features/93-collection-range-indices

Conversation

@feO2x

@feO2x feO2x commented Oct 3, 2023

Copy link
Copy Markdown
Owner

closes #93

In addition to the new Range.For overloads, I also fixed the tests that break in newer .NET versions (because of enums being extended and Enumerable.Range no longer being lazily evaluated).

Comment thread Code/Light.GuardClauses/Range.cs
Comment thread Code/Light.GuardClauses/Range.cs Outdated
Comment thread Code/Light.GuardClauses.Tests/ComparableAssertions/RangeTests.cs
Comment thread Code/Light.GuardClauses.Tests/ComparableAssertions/RangeTests.cs Outdated
feO2x added 2 commits October 6, 2023 09:05
I optimized the new GetCount method so that it also supports IReadOnlyCollection<T> and ICollection<T> properly. It's now faster in .NET 7 than the LINQ Count method on Windows and Linux.

Signed-off-by: Kenny Pflug <[email protected]>
@feO2x

feO2x commented Oct 8, 2023

Copy link
Copy Markdown
Owner Author

@reima if you want to, we can merge this PR

Comment thread Code/Light.GuardClauses.Tests/ComparableAssertions/RangeTests.cs Outdated
@reima

reima commented Oct 8, 2023

Copy link
Copy Markdown

@feO2x Yes, let's merge it! Thank you for your efforts and gathering my feedback along the way. I appreciate it.

@feO2x
feO2x merged commit 74b8cab into dev Oct 9, 2023
@feO2x
feO2x deleted the features/93-collection-range-indices branch October 9, 2023 05:38
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.

Proposal: construct Range of valid indices for strings and collections

2 participants