src/0-legacy/others/wrap/wrapcmp.js
export function wrapcmp ( cmp ) {
return function(a, ai, aj, b, bi, bj){
if (aj - ai + bi - bj < 0) {
return - cmp(b, bi, bj, a, ai, aj);
}
else {
return cmp(a, ai, aj, b, bi, bj);
}
};
}
export function wrapcmp ( cmp ) {
return function(a, ai, aj, b, bi, bj){
if (aj - ai + bi - bj < 0) {
return - cmp(b, bi, bj, a, ai, aj);
}
else {
return cmp(a, ai, aj, b, bi, bj);
}
};
}