scozv / algo-js

[obsoleted] has been moved to project Tango:
https://github.com/scozv/tango
GNU General Public License v3.0
2 stars 1 forks source link

fn and compare function in sorting should be merged into one #6

Closed scozv closed 10 years ago

scozv commented 10 years ago

From Algo.js of Google Code on July 27, 2013 19:07:36

in most sorting functions, we have fn and compare functions as the sorting parameters. actually, they can be merged into one function like compare: (x, y) => fn(x) - fn(y).

Original issue: http://code.google.com/p/algo-js/issues/detail?id=6

scozv commented 10 years ago

From Algo.js of Google Code on July 27, 2013 04:11:13

and, the simplification of parameters is importance for using.

try to use option like { order:'asc', compare:function(){} } as the parameter.

scozv commented 10 years ago

From Algo.js of Google Code on July 29, 2013 23:25:10

fixed in revision 8cffa1c04440 , and run the unit test well

Status: Verified