perf(Scope): don't use forEach in

doesn't make any significant impact on our current benchmarks because we don't have benchmarks with
many scope events, but this is a straightforward change worth doing
This commit is contained in:
Igor Minar
2014-08-11 18:53:08 -07:00
parent 7d96ab0d13
commit 301463a2e2

View File

@@ -824,7 +824,9 @@ function $RootScopeProvider(){
this.$$destroyed = true;
if (this === $rootScope) return;
forEach(this.$$listenerCount, bind(null, decrementListenerCount, this));
for (var eventName in this.$$listenerCount) {
decrementListenerCount(this, this.$$listenerCount[eventName], eventName);
}
// sever all the references to parent scopes (after this cleanup, the current scope should
// not be retained by any of our references and should be eligible for garbage collection)