some refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-01-13 20:50:25 +04:00
parent e5127b85bc
commit 187e538bb9
2 changed files with 17 additions and 17 deletions

View File

@ -427,6 +427,23 @@ function cmp(a, b, get){
}
// Generate a cmp function that will use all the cmp's in cmp_chain in
// sequence if the previous returns 0 (equal).
//
function chainCmp(cmp_chain){
return function(a, b, get, data){
var res
for(var i=0; i < cmp_chain.length; i++){
res = cmp_chain[i](a, b, get, data)
if(res != 0){
return res
}
}
return res
}
}
// Generic image ordering comparison via DATA.order
//
// NOTE: see updateRibbonORder(...) for a general view on image sorting

View File

@ -159,23 +159,6 @@ function imageXPStyleFileNameCmp(a, b, get, data){
}
// Generate a cmp function that will use all the cmp's in cmp_chain in
// sequence if the previous returns 0 (equal).
//
function chainCmp(cmp_chain){
return function(a, b, get, data){
var res
for(var i=0; i < cmp_chain.length; i++){
res = cmp_chain[i](a, b, get, data)
if(res != 0){
return res
}
}
return res
}
}
// Sort action generator...
//
function sortVia(cmp){