Skip to content

Commit

Permalink
Remove redundant (and incorrect) length set. (#256)
Browse files Browse the repository at this point in the history
* Remove redundant (and incorrect) length set.

Fixes issue #255

* Simplify code by using push instead of a variable
  • Loading branch information
NeilFraser authored and codedread committed Jun 11, 2018
1 parent e7f3fbc commit a2df548
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions editor/svgcanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a2df548

Please sign in to comment.