[Pkg-javascript-commits] [backbone] 81/281: bail immediately if !this._changed

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:01:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.9.0
in repository backbone.

commit 0c08ab8185749bb0ddec4dbafc26db15b4f87457
Author: Brad Dunbar <dunbarb2 at gmail.com>
Date:   Thu Nov 10 13:47:11 2011 -0500

    bail immediately if !this._changed
---
 backbone.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backbone.js b/backbone.js
index 5d906f0..3ec4c29 100644
--- a/backbone.js
+++ b/backbone.js
@@ -328,13 +328,13 @@
     // view need to be updated and/or what attributes need to be persisted to
     // the server. Unset attributes will be set to undefined.
     changedAttributes : function(now) {
+      if (!this._changed) return false;
       now || (now = this.attributes);
       var changed = false, old = this._previousAttributes;
       for (var attr in now) {
         if (_.isEqual(old[attr], now[attr])) continue;
         (changed || (changed = {}))[attr] = now[attr];
       }
-      if (!this._changed) return changed;
       for (var attr in old) {
         if (!(attr in now)) (changed || (changed = {}))[attr] = void 0;
       }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list