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
master
Neil Fraser 2018-06-11 08:44:45 -07:00 committed by Jeff Schiller
parent e7f3fbc841
commit a2df54881f
1 changed files with 1 additions and 4 deletions

View File

@ -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);
}