Skip to content

ListPool.Sort #74

@mastef

Description

@mastef

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));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions