Skip to content

Commit

Permalink
Fix duplicate reference issue (#73193)
Browse files Browse the repository at this point in the history
If you have two references that are idetentical, except for casing then
when we insert that value into the Hashset that comparison is not done
ignoring case. And since the Dictionary comparison does, this causes
multiple references that are otherwise identical to be inserted.

This fix just adds the `OrdinalIgnoreCase` comparer to the `HashSet`
  • Loading branch information
DrewScoggins authored Aug 2, 2022
1 parent bb178a8 commit 1a861d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/coreclr/tools/dotnet-pgo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ static int InnerProcessTraceFileMain(CommandLineOptions commandLineOptions)

if (!duplicateModuleAnalysis.TryGetValue(simpleName, out HashSet<string> candidatePaths))
{
duplicateModuleAnalysis[simpleName] = candidatePaths = new HashSet<string>();
duplicateModuleAnalysis[simpleName] = candidatePaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
}
candidatePaths.Add(candidateFilePath);
}
Expand Down

0 comments on commit 1a861d2

Please sign in to comment.