You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the problem, that I have to sort an array by two members, first bei DateAdded and then by Name (both properties of the Member class). Since we can only pass a single member to array.sort, my first idea was to use
sorted = members | array.sort "Name" | array.sort "DateAdded"
BUT this doesn't work, since the internally used List<T>.Sort does NOT use a stable sorting algorithm (see docs).
The solution would be to use a stable sorting algorithm like the one used by Enumberable.OrderBy.
One workaround would be to override the bulitin sort function with:
But in my opinion it would be of great value to use a stable sort algorithm by default. Since this wouldn't be a breaking change I would really welcome to see this fixed in the next release. What do you think?
Even better would be to support sorting by multiple members, which would be much more efficient and performant.
The text was updated successfully, but these errors were encountered:
But in my opinion it would be of great value to use a stable sort algorithm by default. Since this wouldn't be a breaking change I would really welcome to see this fixed in the next release. What do you think?
Yep, makes sense, PR welcome.
Even better would be to support sorting by multiple members, which would be much more efficient and performant.
First of all, this is really an AWESOME project!
I have the problem, that I have to sort an array by two members, first bei
DateAdded
and then byName
(both properties of the Member class). Since we can only pass a single member toarray.sort
, my first idea was to useBUT this doesn't work, since the internally used
List<T>.Sort
does NOT use a stable sorting algorithm (see docs).The solution would be to use a stable sorting algorithm like the one used by
Enumberable.OrderBy
.One workaround would be to override the bulitin sort function with:
But in my opinion it would be of great value to use a stable sort algorithm by default. Since this wouldn't be a breaking change I would really welcome to see this fixed in the next release. What do you think?
Even better would be to support sorting by multiple members, which would be much more efficient and performant.
The text was updated successfully, but these errors were encountered: