From c6197fd12148f0b853caa58ace3dbd2be4da5dc3 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 9 May 2023 10:15:33 -0700 Subject: [PATCH] WIP: Refactor Coder class to use set instead of dict for fnames. --- coder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coder.py b/coder.py index 86db0b542..353ae5c99 100755 --- a/coder.py +++ b/coder.py @@ -29,7 +29,7 @@ openai.api_key = os.getenv("OPENAI_API_KEY") class Coder: - fnames = dict() + fnames = set() last_modified = 0 repo = None @@ -55,7 +55,7 @@ class Coder: else: self.console.print(f"[red]Loading {fname}") - self.fnames[str(fname)] = fname.stat().st_mtime + self.fnames.add(str(fname)) self.set_repo() if not self.repo: @@ -333,7 +333,7 @@ class Coder: self.console.print(f"[red]Skipping edit to {path}") continue - self.fnames[path] = 0 + self.fnames.add(path) edited.add(path) if utils.do_replace(path, original, updated):