From 743ce109a47caa6971c4ec08285e65334a77fbf6 Mon Sep 17 00:00:00 2001 From: Miller Date: Thu, 28 Dec 2023 15:21:09 -0500 Subject: [PATCH] :racehorse: sets for faster searching --- .github/scripts/workflow_to_docker_table.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/scripts/workflow_to_docker_table.py b/.github/scripts/workflow_to_docker_table.py index 349d9bf..dfbacea 100644 --- a/.github/scripts/workflow_to_docker_table.py +++ b/.github/scripts/workflow_to_docker_table.py @@ -28,8 +28,8 @@ def parse_workflow(filepath: str, pathdict: dict | None = None) -> dict: pathdict: Dict containing two lists. One of unique subworkflows; one of unique tools """ if not pathdict: pathdict = {} - if "workflows" not in pathdict: pathdict["workflows"] = [] - if "tools" not in pathdict: pathdict["tools"] = [] + if "workflows" not in pathdict: pathdict["workflows"] = set() + if "tools" not in pathdict: pathdict["tools"] = set() inpath = pathlib.Path(filepath).resolve() with open(inpath) as fh: for line in fh: @@ -38,10 +38,10 @@ def parse_workflow(filepath: str, pathdict: dict | None = None) -> dict: respath = relpath.resolve() if respath in pathdict["workflows"] or respath in pathdict["tools"]: continue if not respath.match('*/tools/*'): - pathdict["workflows"].append(respath) + pathdict["workflows"].add(respath) pathdict = parse_workflow(respath, pathdict) else: - pathdict["tools"].append(respath) + pathdict["tools"].add(respath) return pathdict def get_docker(filepath: str) -> str: