Skip to content

Commit

Permalink
Merge pull request #2207 from stefanpenner/small-perf
Browse files Browse the repository at this point in the history
small perf, this map was unfortunately adding 5ms -> 8ms overhead for pu...
  • Loading branch information
igorT committed Aug 20, 2014
2 parents 48a832c + ab26542 commit 4c27801
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/ember-data/lib/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1438,9 +1438,14 @@ Store = Ember.Object.extend({
@return {Array}
*/
pushMany: function(type, datas) {
return map(datas, function(data) {
return this.push(type, data);
}, this);
var length = datas.length;
var result = new Array(length);

for (var i = 0; i < length; i++) {
result[i] = this.push(type, datas[i]);
}

return result;
},

/**
Expand Down

0 comments on commit 4c27801

Please sign in to comment.