App: Remove duplicate from dependency graph #77
1 changed files with 11 additions and 12 deletions
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 <jan@janware.com>
commit
857e9a6d82
|
|
@ -232,18 +232,17 @@ class App(Base):
|
||||||
for project in projects:
|
for project in projects:
|
||||||
if project in graph:
|
if project in graph:
|
||||||
continue
|
continue
|
||||||
for section in sections:
|
deps = self.get_project_refs(
|
||||||
deps = self.get_project_refs(
|
[project],
|
||||||
[project],
|
['pkg.requires.jw'],
|
||||||
['pkg.requires.jw'],
|
sections,
|
||||||
sections,
|
scope = Scope.One,
|
||||||
scope = Scope.One,
|
add_self = False,
|
||||||
add_self = False,
|
names_only = True,
|
||||||
names_only = True,
|
)
|
||||||
)
|
graph[project] = set(deps)
|
||||||
graph[project] = set(deps)
|
for dep in deps:
|
||||||
for dep in deps:
|
self.__read_dep_graph([dep], sections, graph)
|
||||||
self.__read_dep_graph([dep], sections, graph)
|
|
||||||
|
|
||||||
def __flip_dep_graph(self, graph: Graph) -> Graph:
|
def __flip_dep_graph(self, graph: Graph) -> Graph:
|
||||||
ret: Graph = {}
|
ret: Graph = {}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue