Skip to content
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

Not an issue but a suggestion #2

Open
TyJOrtiz opened this issue Jan 8, 2024 · 0 comments
Open

Not an issue but a suggestion #2

TyJOrtiz opened this issue Jan 8, 2024 · 0 comments

Comments

@TyJOrtiz
Copy link

TyJOrtiz commented Jan 8, 2024

Hi,

I ran across your repo and it's been helpful with a project I'm working on. I noticed in your readme that one of the limitations is that it only works in ascending order.

I played around with it and my suggestion is to maybe find a way to set whether the Collection is in Ascending or Descending order

var match = SortDirection == SortDirection.Ascending ? this.Select((group, index) => new { group, index }).FirstOrDefault(i => i.group.Key.CompareTo(key) >= 0) : this.Select((group, index) => new { group, index }).FirstOrDefault(i => i.group.Key.CompareTo(key) <= 0);

i.group.Key.CompareTo(key) >= 0 for Ascending and i.group.Key.CompareTo(key) <= 0 for Descending.

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

No branches or pull requests

1 participant