Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/common.js

Issue 29418653: Noissue - Do not make a copy of _listeners while dispatching (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created April 20, 2017, 5:43 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/common.js
===================================================================
--- a/ext/common.js
+++ b/ext/common.js
@@ -32,19 +32,18 @@
},
removeListener(listener)
{
this._listeners.delete(listener);
},
_dispatch(...args)
{
let results = [];
- let listeners = [...this._listeners];
- for (let listener of listeners)
+ for (let listener of this._listeners)
results.push(listener(...args));
return results;
}
};
// Workaround since HTMLCollection and NodeList didn't have iterator support
// before Chrome 51.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld