PERF401: fix

This commit is contained in:
Jörg Thalheim
2025-08-20 19:56:18 +02:00
parent 136acc7901
commit c65bb0b1ce
9 changed files with 75 additions and 79 deletions

View File

@@ -23,13 +23,9 @@ sops_groups_folder = gen_sops_subfolder("groups")
def list_objects(path: Path, is_valid: Callable[[str], bool]) -> list[str]:
objs: list[str] = []
if not path.exists():
return objs
for f in path.iterdir():
if is_valid(f.name):
objs.append(f.name)
return objs
return []
return [f.name for f in path.iterdir() if is_valid(f.name)]
def remove_object(path: Path, name: str) -> list[Path]: