From b14bee084ba2ebe441fc7834e94bfb8de5e4bbf5 Mon Sep 17 00:00:00 2001 From: Tom Fili Date: Fri, 24 Jun 2016 15:47:49 -0400 Subject: [PATCH] Sped up deleting of custom data from a QuadtreeTile. --- Source/Scene/QuadtreeTile.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Source/Scene/QuadtreeTile.js b/Source/Scene/QuadtreeTile.js index 8fcd19694427..5bce6f21acf5 100644 --- a/Source/Scene/QuadtreeTile.js +++ b/Source/Scene/QuadtreeTile.js @@ -143,16 +143,10 @@ define([ var rectangle; if (defined(added) && defined(removed)) { - // level zero tile - for (i = 0; i < removed.length; ++i) { - data = removed[i]; - for (var j = 0; j < customData.length; ++j) { - if (customData[j] === data) { - customData.splice(j, 1); - break; - } - } - } + customData = customData.filter(function(value) { + return removed.indexOf(value) === -1; + }); + this._customData = customData; rectangle = this._rectangle; for (i = 0; i < added.length; ++i) {