From 272a4bbe61146d3e6d9cb0cb2d9ffb0caac38296 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Sat, 5 Apr 2014 17:31:36 +0100 Subject: [PATCH] Filtering optimisations --- boot/boot.js | 25 ++++++++++++------------- core/modules/filters/all/shadows.js | 6 +----- core/modules/filters/all/tiddlers.js | 6 +----- core/modules/utils/utils.js | 27 ++++++++++++++++++++------- 4 files changed, 34 insertions(+), 30 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index e4a814d8f..0be9aa274 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -73,13 +73,11 @@ Iterate through all the own properties of an object or array. Callback is invoke $tw.utils.each = function(object,callback) { var f; if(object) { - if($tw.utils.isArray(object)) { - for(f=0; f=0; t--) { + p = value.indexOf(array[t]); + if(p !== -1) { + array.splice(t,1); + } + } + } } + // Push the values on top of the main array + array.push.apply(array,value); } - // Push the values on top of the main array - array.push.apply(array,value); } else { p = array.indexOf(value); if(p !== -1) {