From a2df54881f6b3a4aabb646e60838ea6a7725c913 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Mon, 11 Jun 2018 08:44:45 -0700 Subject: [PATCH] Remove redundant (and incorrect) length set. (#256) * Remove redundant (and incorrect) length set. Fixes issue #255 * Simplify code by using push instead of a variable --- editor/svgcanvas.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 719462ac..39df6842 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1108,17 +1108,14 @@ const selectOnly = this.selectOnly = function (elems, showGrips) { if (!elemsToRemove.length) { return; } // find every element and remove it from our array copy - let j = 0; const newSelectedItems = [], len = selectedElements.length; - newSelectedItems.length = len; for (let i = 0; i < len; ++i) { const elem = selectedElements[i]; if (elem) { // keep the item if (!elemsToRemove.includes(elem)) { - newSelectedItems[j] = elem; - j++; + newSelectedItems.push(elem); } else { // remove the item and its selector selectorManager.releaseSelector(elem); }