From ee57d6892248ec4851d7f03b8aaecd787b327a9d Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 20 Jan 2014 05:40:19 +0400 Subject: [PATCH] updated docs... Signed-off-by: Alex A. Naanou --- ui/data.js | 8 ++------ ui/marks.js | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ui/data.js b/ui/data.js index 6c72c70e..f00b0116 100755 --- a/ui/data.js +++ b/ui/data.js @@ -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)) } diff --git a/ui/marks.js b/ui/marks.js index 5a9252ef..c445ad01 100755 --- a/ui/marks.js +++ b/ui/marks.js @@ -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