Skip to content

Commit f9b8ab7

Browse files
committed
Avoid allocating some closures for iteration
1 parent 204c4a3 commit f9b8ab7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

addon/components/-private/row-wrapper.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export default Component.extend({
4343
},
4444

4545
destroy() {
46-
this._cells.forEach(cell => cell.destroy());
46+
for (let cell of this._cells) {
47+
cell.destroy();
48+
}
4749

4850
this._super(...arguments);
4951
},
@@ -94,7 +96,8 @@ export default Component.extend({
9496
}
9597
}
9698

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

@@ -107,7 +110,7 @@ export default Component.extend({
107110
rowSelectionMode,
108111
rowValue,
109112
});
110-
});
113+
}
111114

112115
return _cells;
113116
}

0 commit comments

Comments
 (0)