From a443d66473c4af970786fa5f21ca485e8d12be09 Mon Sep 17 00:00:00 2001 From: Mike Mueller Date: Fri, 2 Mar 2012 17:04:21 -0800 Subject: [PATCH] Fix a performance issue in _find_solutions. WordTwist successors can take you in circles (scare > stare > scare), so check for this condition to avoid generating overly many potential solutions. --- plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin.py b/plugin.py index d74e8c3..a23a9cf 100644 --- a/plugin.py +++ b/plugin.py @@ -277,6 +277,8 @@ class WordChain(BaseGame): else: words = self._get_successors(seed[-1]) for word in words: + if word in seed: + continue if word == self.solution[-1]: self.solutions.append(seed + [word]) else: