From 8535fdde4f7dae1a1a5148d25ee0829423e92e7e Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 9 Oct 2016 13:41:12 +0100 Subject: Remove description from registry entry for key-state mapping. We do not need the registryEntry's decription in the content scripts, so remove it (saving a marginal amount of memory and time). --- background_scripts/commands.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 674a1e22..7a4526c2 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -127,8 +127,9 @@ Commands = else if index < registryEntry.keySequence.length - 1 currentMapping = currentMapping[key] ?= {} else - delete registryEntry.keySequence # We don't need this any more. - currentMapping[key] = registryEntry + currentMapping[key] = extend {}, registryEntry + # We don't need these properties in the content scripts. + delete registryEntry[prop] for prop in ["keySequence", "description"] chrome.storage.local.set normalModeKeyStateMapping: keyStateMapping # An ordered listing of all available commands, grouped by type. This is the order they will -- cgit v1.2.3