mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-06-15 01:49:05 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user