Skip to content

Commit

Permalink
remove forEach + closure overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpenner committed Mar 16, 2017
1 parent 13bbb8c commit 96c147b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addon/-private/system/record-array-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,18 @@ export default class RecordArrayManager {
this._pending = Object.create(null);
let modelsToRemove = [];

Object.keys(pending).forEach(modelName => {
for (let modelName in pending) {
let internalModels = pending[modelName];

internalModels.forEach(internalModel => {
for (let j = 0; j < internalModels.length; j++) {
let internalModel = internalModels[j];
// mark internalModels, so they can once again be processed by the
// recordArrayManager
internalModel._pendingRecordArrayManagerFlush = false;
// build up a set of models to ensure we have purged correctly;
if (internalModel.isHiddenFromRecordArrays()) {
modelsToRemove.push(internalModel);
}
});
}

// process filteredRecordArrays
if (this._filteredRecordArrays[modelName]) {
Expand All @@ -136,7 +136,7 @@ export default class RecordArrayManager {
if (modelsToRemove.length > 0) {
this.removeFromAdapterPopulatedRecordArrays(modelsToRemove);
}
});
}
}

updateLiveRecordArray(modelName, internalModels) {
Expand Down

0 comments on commit 96c147b

Please sign in to comment.