Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
cr cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelw committed Jan 3, 2014
1 parent a96bd3f commit b28c2db
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@
}

function getObservedObject(observer, object, arrayObserve) {
var dir = observedObjectCache.length ? observedObjectCache.pop() :
newObservedObject();
var dir = observedObjectCache.pop() || newObservedObject();
dir.open(observer);
dir.observe(object, arrayObserve);
return dir;
Expand Down Expand Up @@ -445,20 +444,20 @@
Object.unobserve(obj, callback);
}

toRemove.length = 0;;
toRemove.length = 0;
},
close: function() {
for (var i = 0; i < objects.length; i++)
for (var i = 0; i < objects.length; i++) {
Object.unobserve(objects[i], callback);
}
objects.length = 0;
observedSetCache.push(this);
}
};
}

function getObservedSet(observer) {
var set = observedSetCache.length ? observedSetCache.pop() :
newObservedSet();
var set = observedSetCache.pop() || newObservedSet();
set.open(observer);
return set;
}
Expand Down

0 comments on commit b28c2db

Please sign in to comment.