From 778f2bdf1af8c86700fc8ce7418567c7c26f4a73 Mon Sep 17 00:00:00 2001 From: Andrew Epstein Date: Wed, 22 Feb 2017 07:56:40 -0500 Subject: [PATCH] Improve performance of history rule --- thefuck/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thefuck/utils.py b/thefuck/utils.py index f6c0bb71..2bb20a22 100644 --- a/thefuck/utils.py +++ b/thefuck/utils.py @@ -264,7 +264,7 @@ def get_valid_history_without_current(command): from thefuck.shells import shell history = shell.get_history() tf_alias = get_alias() - executables = get_all_executables() + executables = set(get_all_executables()) return [line for line in _not_corrected(history, tf_alias) if not line.startswith(tf_alias) and not line == command.script and line.split(' ')[0] in executables]