-
Notifications
You must be signed in to change notification settings - Fork 2
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
Dialac dev #16
base: add-system-sorting
Are you sure you want to change the base?
Dialac dev #16
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.