Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 301463a

Browse files
committed
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
1 parent 7d96ab0 commit 301463a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ng/rootScope.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,9 @@ function $RootScopeProvider(){
824824
this.$$destroyed = true;
825825
if (this === $rootScope) return;
826826

827-
forEach(this.$$listenerCount, bind(null, decrementListenerCount, this));
827+
for (var eventName in this.$$listenerCount) {
828+
decrementListenerCount(this, this.$$listenerCount[eventName], eventName);
829+
}
828830

829831
// sever all the references to parent scopes (after this cleanup, the current scope should
830832
// not be retained by any of our references and should be eligible for garbage collection)

0 commit comments

Comments
 (0)