Skip to content

Commit

Permalink
Acyclic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Dec 8, 2024
1 parent 419b397 commit 418e1fc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/aql/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ func (aqlq AQLquery) Resolve(opts ResolverOptions) (*graph.Graph[*engine.Object,
// Iterate over all starting nodes
aqlq.sourceCache[nodeindex].IterateParallel(func(o *engine.Object) bool {
searchResult := graph.NewGraph[*engine.Object, engine.EdgeBitmap]()
if aqlq.Mode == Acyclic {
aqlq.sourceCache[nodeindex].Iterate(func(node *engine.Object) bool {
searchResult.AddNode(node)
return true
})
}
aqlq.resolveEdgesFrom(opts, &searchResult, nil, o, 0, 0, 0, 1)
resultlock.Lock()
result.Merge(searchResult)
Expand Down Expand Up @@ -210,8 +204,14 @@ func (aqlq AQLquery) resolveEdgesFrom(
directions = directionsAny
}
// We don't need matches, so try skipping this one
if es.MinIterations == 0 && currentDepth == 0 && len(aqlq.Sources) > currentSearchIndex+1 {
aqlq.resolveEdgesFrom(opts, committedGraph, workingGraph, currentObject, currentSearchIndex+1, 0, currentTotalDepth+1, currentOverAllProbability)
if es.MinIterations == 0 && currentDepth == 0 {
if len(aqlq.Sources) > currentSearchIndex+1 {
aqlq.resolveEdgesFrom(opts, committedGraph, workingGraph, currentObject, currentSearchIndex+1, 0, currentTotalDepth+1, currentOverAllProbability)
} else {
// can't go deeper, it's the last one and it isn't required, so we're done :-)
committedGraph.Merge(*workingGraph)
return
}
}
// Then look for stuff that match in within the min and max iteration requirements
for _, direction := range directions {
Expand Down

0 comments on commit 418e1fc

Please sign in to comment.