mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 14:40:17 +00:00
fix(compiler): Fix search for one element cycles (#797)
This commit is contained in:
parent
0f9c40e9d1
commit
33ab33d4c8
@ -40,12 +40,10 @@ object Linker extends Logging {
|
||||
case path :: otherPaths =>
|
||||
val pathDeps = deps.get(path.last).toList.flatten
|
||||
val cycles = pathDeps.flatMap(dep =>
|
||||
NonEmptyChain
|
||||
.fromChain(
|
||||
NonEmptyChain.fromChain(
|
||||
// This is slow
|
||||
path.toChain.dropWhile(_ != dep)
|
||||
)
|
||||
.toList
|
||||
)
|
||||
val newPaths = pathDeps
|
||||
.filterNot(visited.contains)
|
||||
@ -62,7 +60,7 @@ object Linker extends Logging {
|
||||
.flatMap(m =>
|
||||
findCycles(
|
||||
paths = NonEmptyChain.one(m.id) :: Nil,
|
||||
visited = Set.empty,
|
||||
visited = Set(m.id),
|
||||
result = List.empty
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user