Skip to content

Commit 9cb74c6

Browse files
committed
fix: Addressing allComponents mutability issue
1 parent a480917 commit 9cb74c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/discovery/phase_graph.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ func (p *GraphPhase) runGraphDiscovery(
149149
return
150150
}
151151

152-
allComponents := input.Components
153-
allComponents = append(allComponents, resultsToComponents(input.Candidates)...)
152+
candidateComponents := resultsToComponents(input.Candidates)
153+
allComponents := make([]component.Component, 0, len(input.Components)+len(candidateComponents))
154+
allComponents = append(allComponents, input.Components...)
155+
allComponents = append(allComponents, candidateComponents...)
154156
threadSafeComponents := component.NewThreadSafeComponents(allComponents)
155157

156158
graphTargetCandidates := make([]DiscoveryResult, 0, len(input.Candidates))

0 commit comments

Comments
 (0)