From 857e9a6d82e5c5ebb36a10179b180761546fcf71 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 15 Aug 2026 22:21:07 +0200 Subject: [PATCH] App.__read_dep_graph(): Remove redundant loop __read_dep_graph() iterates over the given sections (flavours), but the loop body does not use the loop variable: it passes the entire sections list to get_project_refs() on every iteration, so the same lookup is repeated for each section, and the recursion into the found dependencies is re-triggered (and skipped) for each of them. Remove the loop and do the lookup once per project. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2 Signed-off-by: Jan Lindemann --- src/python/jw/pkg/App.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/python/jw/pkg/App.py b/src/python/jw/pkg/App.py index 7abc3040..1e1a5d3b 100644 --- a/src/python/jw/pkg/App.py +++ b/src/python/jw/pkg/App.py @@ -232,18 +232,17 @@ class App(Base): for project in projects: if project in graph: continue - for section in sections: - deps = self.get_project_refs( - [project], - ['pkg.requires.jw'], - sections, - scope = Scope.One, - add_self = False, - names_only = True, - ) - graph[project] = set(deps) - for dep in deps: - self.__read_dep_graph([dep], sections, graph) + deps = self.get_project_refs( + [project], + ['pkg.requires.jw'], + sections, + scope = Scope.One, + add_self = False, + names_only = True, + ) + graph[project] = set(deps) + for dep in deps: + self.__read_dep_graph([dep], sections, graph) def __flip_dep_graph(self, graph: Graph) -> Graph: ret: Graph = {}