Skip to main content

expansions: don’t construct a path we aren’t using

ID
f16fc92
date
2026-04-18 17:30:30+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
67c8351
message
expansions: don't construct a path we aren't using
changed files
1 file, 1 addition, 3 deletions

Changed files

expansions/get_file_paths.py (695) → expansions/get_file_paths.py (676)

diff --git a/expansions/get_file_paths.py b/expansions/get_file_paths.py
index b5eec33..7d58eee 100644
--- a/expansions/get_file_paths.py
+++ b/expansions/get_file_paths.py
@@ -18,10 +18,8 @@ def get_file_paths_under(
 
     for dirpath, _, filenames in root.walk():
         for f in filenames:
-            p = dirpath / f
-
             if not suffix or f.lower().endswith(suffix):
-                yield p
+                yield dirpath / f
 
 
 for p in get_file_paths_under():