App.__find_circular_deps(): Move __flip_dep_graph() out
The __flip_dep_graph(graph) call sits inside the while loop and performs redundant graph flipping on every iteration. Hoist it outside to compute once and reuse the result.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.devSigned-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
9fa617cfc8
commit
83d6f4b2df
1 changed files with 2 additions and 1 deletions
|
|
@ -319,11 +319,12 @@ class App(Base):
|
|||
self.__read_dep_graph(projects, flavours, graph)
|
||||
unvisited = list(graph.keys())
|
||||
temp: set[str] = set()
|
||||
flipped = self.__flip_dep_graph(graph)
|
||||
while unvisited:
|
||||
project = unvisited[0]
|
||||
log(DEBUG, 'Checking circular dependency of', project)
|
||||
last = self.__find_circular_deps_recursive(
|
||||
project, self.__flip_dep_graph(graph), unvisited, temp, ret
|
||||
project, flipped, unvisited, temp, ret
|
||||
)
|
||||
if last is not None:
|
||||
log(DEBUG, f'Found circular dependency below {project}, last is {last}')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue