updated docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-01-20 05:40:19 +04:00
parent b131edd95c
commit ee57d68922
2 changed files with 2 additions and 7 deletions

View File

@ -611,11 +611,9 @@ function populateSparceGIDList(gids, target, data){
// Remove all the undefined's form a sparse list...
//
function compactSparceList(lst){
// XXX is it normal that .filter(..) skips undefined values?
// NOTE: JS arrays are sparse, so all the iterators will return only
// the actually existing items...
return lst.filter(function(){ return true })
//return lst.filter(function(e){
// return e !== undefined
//})
}
@ -647,8 +645,6 @@ function compactSparceList(lst){
// console.log('T:', Date.now()-t0)
// >>> T: 171
//
// On the down side, this has some memory overhead -- ~ N - n * ref
//
function fastSortGIDsByOrder(gids, data){
return compactSparceList(populateSparceGIDList(gids, data))
}

View File

@ -16,7 +16,6 @@
// - trivial sorting
// - less maintenance and sync
// The tradeoff being:
// - more memory usage
// - load/save conversion to keep the json data "packed".
// NOTE: it would appear that JS is designed with sparse lists in mind:
// - all iterators (map, filter, forEach, ..) skip undefined values