File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -205,14 +205,19 @@ export default class DataManager {
205
205
}
206
206
207
207
prepareRow ( row , meta ) {
208
- const baseRowCell = {
209
- rowIndex : meta . rowIndex ,
210
- indent : meta . indent
211
- } ;
212
-
213
208
row = row
214
209
. map ( ( cell , i ) => this . prepareCell ( cell , i ) )
215
- . map ( cell => Object . assign ( { } , baseRowCell , cell ) ) ;
210
+ . map ( cell => {
211
+ // Following code is equivalent but avoids memory allocation and copying.
212
+ // return Object.assign({rowIndex: meta.rowIndex, indent: meta.indent}, cell)
213
+ if ( cell . rowIndex == null ) {
214
+ cell . rowIndex = meta . rowIndex ;
215
+ }
216
+ if ( cell . indent == null ) {
217
+ cell . indent = meta . indent ;
218
+ }
219
+ return cell ;
220
+ } ) ;
216
221
217
222
// monkey patched in array object
218
223
row . meta = meta ;
You can’t perform that action at this time.
0 commit comments