aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-10-09 13:41:12 +0100
committerStephen Blott2016-10-09 13:41:12 +0100
commit8535fdde4f7dae1a1a5148d25ee0829423e92e7e (patch)
tree045d75dcd745b0d5b456227a64405ce5fb8822c6
parent895925600e37cc88c95d1864faebe6e7aa05348a (diff)
downloadvimium-8535fdde4f7dae1a1a5148d25ee0829423e92e7e.tar.bz2
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).
-rw-r--r--background_scripts/commands.coffee5
1 files changed, 3 insertions, 2 deletions
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