Skip to content

Commit

Permalink
Avoid allocating some closures for iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed May 23, 2019
1 parent 204c4a3 commit 92d3fed
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions addon/components/-private/row-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export default Component.extend({
},

destroy() {
this._cells.forEach(cell => cell.destroy());
for (let cell in this._cells) {
cell.destroy();
}

this._super(...arguments);
},
Expand Down Expand Up @@ -94,7 +96,8 @@ export default Component.extend({
}
}

_cells.forEach((cell, i) => {
for (let i = 0; i < this._cells.length; i++) {
let cell = this._cells[i];
let columnValue = objectAt(columns, i);
let columnMeta = this.get('columnMetaCache').get(columnValue);

Expand All @@ -107,7 +110,7 @@ export default Component.extend({
rowSelectionMode,
rowValue,
});
});
}

return _cells;
}
Expand Down

0 comments on commit 92d3fed

Please sign in to comment.