From 649427dd33e691bc93f90fe0b04de9372defbb17 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Sun, 7 Jul 2024 13:44:10 -0700 Subject: [PATCH] Made a fix that should work better --- mfbatch/commands.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mfbatch/commands.py b/mfbatch/commands.py index 144a7da..367859d 100644 --- a/mfbatch/commands.py +++ b/mfbatch/commands.py @@ -63,15 +63,6 @@ class CommandEnv: self.incr.pop(k, None) self.patterns.pop(k, None) - - # delete all patterns that refer to the key - refs = [] - for pattern_key, (frm, _, _) in self.patterns: - if frm == k: - refs.append(pattern_key) - - for ref in refs: - del self.patterns[ref] def reset_keys(self): @@ -80,6 +71,9 @@ class CommandEnv: for key in all_keys: self.unset_key(key) + self.patterns = {} + self.incr = {} + def set_pattern(self, to: str, frm: str, pattern: str, repl: str): """