From c1b1efd4d83bef1fbc77b22f90a3c59bc3923ecd Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 16 Dec 2018 05:00:11 +0300 Subject: [PATCH] notes + tweaking + a substantial performance fix... Signed-off-by: Alex A. Naanou --- ui (gen4)/imagegrid/tags.js | 2 ++ ui (gen4)/lib/util.js | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui (gen4)/imagegrid/tags.js b/ui (gen4)/imagegrid/tags.js index d06278c7..e0cfdac8 100755 --- a/ui (gen4)/imagegrid/tags.js +++ b/ui (gen4)/imagegrid/tags.js @@ -1493,6 +1493,8 @@ object.makeConstructor('BaseTags', //--------------------------------------------------------------------- // XXX EXPERIMENTAL... +// try using this to implement local tags in collections by defining +// a '/local/*' handler... var TagsWithHandlersPrototype = { __proto__: BaseTagsPrototype, diff --git a/ui (gen4)/lib/util.js b/ui (gen4)/lib/util.js index d2a756f8..ad2ace18 100755 --- a/ui (gen4)/lib/util.js +++ b/ui (gen4)/lib/util.js @@ -202,7 +202,6 @@ Array.prototype.sortAs = function(other){ // Set... // Set set operation shorthands... -// XXX should these accept lists of sets??? Set.prototype.unite = function(other){ return new Set([...this, ...other]) } Set.prototype.intersect = function(other){ @@ -210,9 +209,9 @@ Set.prototype.intersect = function(other){ return new Set([...this] .filter(function(e){ return other[test](e) })) } Set.prototype.subtract = function(other){ - var test = other.has ? 'has' : 'includes' + other = new Set(other) return new Set([...this] - .filter(function(e){ return !other[test](e) })) } + .filter(function(e){ return !other.has(e) })) } //---------------------------------------------------------------------