PERF: avoid get in sensitive path

This commit is contained in:
Sam 2014-06-02 11:20:37 +10:00
parent f8c095873c
commit 2dc50ced4c

View file

@ -303,7 +303,8 @@ Discourse.Post = Discourse.Model.extend({
var post = this;
Object.keys(otherPost).forEach(function (key) {
var value = otherPost[key];
var oldValue = post.get(key);
// optimisation
var oldValue = post[key];
if(!value) {
value = null;