Closed sunrize531 closed 6 years ago
Indeed. Since List is far from being an ideal structure for sorting, the current implementation provided is merely provided for completeness. PRs welcome for a less wasteful list sort.
Well, for 'competeness' it must pass its arguments to sorted.
Then, it would be nice to implement something like this: http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
I'll see what i can do here in next couple of days.
see #191
https://github.com/montagejs/collections/blob/master/list.js#L372
Also it probably can be MUCH faster, using node swaps, especially for large collections, since currently it converting data to array and back.