Skip to content

Commit 2132302

Browse files
committed
Avoid allocating some closures for iteration
1 parent 0671056 commit 2132302

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
@@ -53,7 +53,9 @@ export default Component.extend({
5353
},
5454

5555
destroy() {
56-
this._cells.forEach(cell => cell.destroy());
56+
for (let cell of this._cells) {
57+
cell.destroy();
58+
}
5759

5860
this._super(...arguments);
5961
},
@@ -114,7 +116,8 @@ export default Component.extend({
114116
}
115117
}
116118

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

@@ -128,7 +131,7 @@ export default Component.extend({
128131
rowValue,
129132
rowsCount,
130133
});
131-
});
134+
}
132135

133136
return _cells;
134137
}

0 commit comments

Comments
 (0)