simplified the sort function

This commit is contained in:
Thomas Aylott 2013-11-18 16:03:57 -05:00
parent c6f7fe00fa
commit 5ae152cdcf
1 changed files with 2 additions and 7 deletions

View File

@ -15,14 +15,9 @@ module.exports = function(){
Object.keys(results)
.sort(function(a, b){
if (results[a].length > results[b].length) {
return -1;
}
if (results[a].length < results[b].length) {
return 1;
}
return 0;
return results[a].length - results[b].length;
})
.reverse()
.forEach(function(path){
if (results[path].length === 0) {
return;