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

ListPool.Sort #74

Open
mastef opened this issue May 31, 2024 · 0 comments · May be fixed by #75
Open

ListPool.Sort #74

mastef opened this issue May 31, 2024 · 0 comments · May be fixed by #75

Comments

@mastef
Copy link

mastef commented May 31, 2024

Very cool project, we like it a lot.

Only thing that we're kind of missing are the sort methods

        public void Sort(Comparison<T> comparison);
        public void Sort(int index, int count, IComparer<T> comparer);
        public void Sort();
        public void Sort(IComparer<T> comparer);

I think it would be as simple as

	public void Sort() => Sort(0, Count, null);
	public void Sort(IComparer<T> comparer) => Sort(0, Count, comparer);
	public void Sort(int index, int count, IComparer<T> comparer) => Array.Sort<T>(_items, index, count, comparer);
	public void Sort(Comparison<T> comparison) => Array.Sort<T>(_items, 0, Count, Comparer<T>.Create(comparison));
@mastef mastef linked a pull request Jun 3, 2024 that will close this issue
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 a pull request may close this issue.

1 participant