Conversation
| /// <param name="index"></param> | ||
| /// <param name="length"></param> | ||
| /// <param name="comparer"></param> | ||
| internal virtual void SortInternal<T>(T[] array, int index, int length, IComparer<T> comparer) //where T : IComparable |
There was a problem hiding this comment.
It would be better if this was protected and abstract. It being abstract will require it to be implemented.
The convention we follow for methods were you have to implement them but not do argument checking is to suffix the method with the word "Core", so I would also rename this to SortCore.
|
Would you mind doing a pass over this and removing the commented out code if it's not needed? |
|
|
||
| T[] control = SimpleSort<T>(array, index, length, comparer); | ||
|
|
||
| //TODO - Can use Reflection to get the derivedTypes of Sorting and invoking the methods. |
There was a problem hiding this comment.
I call out later why I think this is a bad idea here but if you needed to do this at some other point you would want to use the MakeGenericType method on TypeInfo to substitute concrete values for the type parameters and then use Activator.CreateInstance to build an instance of that type.
This is the refactoring class for Array.Sort method.
This work is tracked by Issue - #13
One change that happened since the issue was filled is that Instead of having Sorting Class generic, I made the method Sorting.Sort Generic because of backwards compatibility for the existent overloaded methods that receives Key and Value pair.