@@ -117,7 +117,7 @@ public class ResolvedProject
117
117
public string ProjectFile ;
118
118
119
119
// Resolved Project dependencies
120
- public List < ResolvedProject > Dependencies = new List < ResolvedProject > ( ) ;
120
+ public HashSet < ResolvedProject > Dependencies = new HashSet < ResolvedProject > ( ) ;
121
121
122
122
// User data, may be use by generator to attach user data
123
123
public Dictionary < string , object > UserData = new Dictionary < string , object > ( ) ;
@@ -191,8 +191,7 @@ public IEnumerable<ResolvedProject> GetResolvedProjects(IEnumerable<Configuratio
191
191
resolvedProject . Configurations . Add ( includedProjectInfo . Configuration ) ;
192
192
resolvedProject . SolutionConfigurationsBuild . Add ( solutionConfiguration , includedProjectInfo . ToBuild ) ;
193
193
194
- if ( ! configurationsToProjects . ContainsKey ( includedProjectInfo . Configuration ) )
195
- configurationsToProjects [ includedProjectInfo . Configuration ] = resolvedProject ;
194
+ configurationsToProjects . TryAdd ( includedProjectInfo . Configuration , resolvedProject ) ;
196
195
}
197
196
}
198
197
@@ -219,12 +218,11 @@ public IEnumerable<ResolvedProject> GetResolvedProjects(IEnumerable<Configuratio
219
218
220
219
foreach ( Project . Configuration dependencyConfiguration in resolvedProjectConf . ResolvedDependencies )
221
220
{
222
- if ( configurationsToProjects . ContainsKey ( dependencyConfiguration ) )
223
- {
224
- var resolvedProjectToAdd = configurationsToProjects [ dependencyConfiguration ] ;
221
+ ResolvedProject resolvedProjectToAdd ;
225
222
226
- if ( ! resolvedProject . Dependencies . Contains ( resolvedProjectToAdd ) )
227
- resolvedProject . Dependencies . Add ( resolvedProjectToAdd ) ;
223
+ if ( configurationsToProjects . TryGetValue ( dependencyConfiguration , out resolvedProjectToAdd ) )
224
+ {
225
+ resolvedProject . Dependencies . Add ( resolvedProjectToAdd ) ;
228
226
}
229
227
}
230
228
}
0 commit comments