diff options
author | Jay Kamat <jaygkamat@gmail.com> | 2019-03-16 17:24:38 -0700 |
---|---|---|
committer | Jay Kamat <jaygkamat@gmail.com> | 2019-03-16 17:31:41 -0700 |
commit | c4d254b59f223186c619a9d4c2e47b42d9fa54e2 (patch) | |
tree | 1110161951735296d574e85b25b76a992f889e18 /qutebrowser | |
parent | c8063be3fba56bad6e937fc485db33b885fcaff0 (diff) | |
download | qutebrowser-c4d254b59f223186c619a9d4c2e47b42d9fa54e2.tar.gz qutebrowser-c4d254b59f223186c619a9d4c2e47b42d9fa54e2.zip |
Cache hot config accesses in key parser
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/commands/runners.py | 6 | ||||
-rw-r--r-- | qutebrowser/keyinput/modeman.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/qutebrowser/commands/runners.py b/qutebrowser/commands/runners.py index 000689a75..666c79f3e 100644 --- a/qutebrowser/commands/runners.py +++ b/qutebrowser/commands/runners.py @@ -121,10 +121,10 @@ class CommandParser: otherwise. """ parts = text.strip().split(maxsplit=1) - try: - alias = config.val.aliases[parts[0]] - except KeyError: + alias = config.cache['aliases'] + if parts[0] not in alias: return default + alias = alias[parts[0]] try: new_cmd = '{} {}'.format(alias, parts[1]) diff --git a/qutebrowser/keyinput/modeman.py b/qutebrowser/keyinput/modeman.py index edb443eec..e9b3f1db3 100644 --- a/qutebrowser/keyinput/modeman.py +++ b/qutebrowser/keyinput/modeman.py @@ -176,7 +176,7 @@ class ModeManager(QObject): event.modifiers() not in [Qt.NoModifier, Qt.ShiftModifier] or not event.text().strip()) - forward_unbound_keys = config.val.input.forward_unbound_keys + forward_unbound_keys = config.cache['input.forward_unbound_keys'] if match: filter_this = True |