PERF: avoid get in sensitive path

This commit is contained in:
Sam 2014-06-02 11:20:37 +10:00
parent f8c095873c
commit 2dc50ced4c
1 changed files with 2 additions and 1 deletions

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;