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

Unified Diff: options.js

Issue 29417597: Issue 5161 - Use maps and sets where appropriate (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Revert previous change and remove unnecessary logic Created May 19, 2017, 4:15 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 | « lib/whitelisting.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: options.js
===================================================================
--- a/options.js
+++ b/options.js
@@ -32,23 +32,17 @@
* value arguments are optional their index must be
* maintained. E.g. if you omit the first value you
* must omit the second too.)
*/
function wrapper(baseMessage, ...paramKeys)
{
return function(...paramValues /* , callback */)
{
- let message = Object.create(null);
- for (let key in baseMessage)
- {
- if (baseMessage.hasOwnProperty(key))
- message[key] = baseMessage[key];
- }
-
+ let message = Object.assign(Object.create(null), baseMessage);
let callback;
if (paramValues.length > 0)
{
let lastArg = paramValues[paramValues.length - 1];
if (typeof lastArg == "function")
callback = lastArg;
« no previous file with comments | « lib/whitelisting.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld