@@ -117,7 +117,7 @@ public class ResolvedProject
117117 public string ProjectFile ;
118118
119119 // Resolved Project dependencies
120- public List < ResolvedProject > Dependencies = new List < ResolvedProject > ( ) ;
120+ public HashSet < ResolvedProject > Dependencies = new HashSet < ResolvedProject > ( ) ;
121121
122122 // User data, may be use by generator to attach user data
123123 public Dictionary < string , object > UserData = new Dictionary < string , object > ( ) ;
@@ -191,8 +191,7 @@ public IEnumerable<ResolvedProject> GetResolvedProjects(IEnumerable<Configuratio
191191 resolvedProject . Configurations . Add ( includedProjectInfo . Configuration ) ;
192192 resolvedProject . SolutionConfigurationsBuild . Add ( solutionConfiguration , includedProjectInfo . ToBuild ) ;
193193
194- if ( ! configurationsToProjects . ContainsKey ( includedProjectInfo . Configuration ) )
195- configurationsToProjects [ includedProjectInfo . Configuration ] = resolvedProject ;
194+ configurationsToProjects . TryAdd ( includedProjectInfo . Configuration , resolvedProject ) ;
196195 }
197196 }
198197
@@ -219,12 +218,11 @@ public IEnumerable<ResolvedProject> GetResolvedProjects(IEnumerable<Configuratio
219218
220219 foreach ( Project . Configuration dependencyConfiguration in resolvedProjectConf . ResolvedDependencies )
221220 {
222- if ( configurationsToProjects . ContainsKey ( dependencyConfiguration ) )
223- {
224- var resolvedProjectToAdd = configurationsToProjects [ dependencyConfiguration ] ;
221+ ResolvedProject resolvedProjectToAdd ;
225222
226- if ( ! resolvedProject . Dependencies . Contains ( resolvedProjectToAdd ) )
227- resolvedProject . Dependencies . Add ( resolvedProjectToAdd ) ;
223+ if ( configurationsToProjects . TryGetValue ( dependencyConfiguration , out resolvedProjectToAdd ) )
224+ {
225+ resolvedProject . Dependencies . Add ( resolvedProjectToAdd ) ;
228226 }
229227 }
230228 }
0 commit comments