Skip to content

Commit

Permalink
Careful assignment of ProjectID - Avoids project collisions
Browse files Browse the repository at this point in the history
All @Hosch250's work
  • Loading branch information
ThunderFrame committed Jun 7, 2016
1 parent 7123cac commit 70a49e9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Rubberduck.Parsing/VBA/RubberduckParserState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,15 @@ public void AddProject(VBProject project)
return;
}

if (string.IsNullOrEmpty(project.HelpFile))
//if (string.IsNullOrEmpty(project.HelpFile))
//{
// project.HelpFile = project.GetHashCode().ToString();
//}
while (string.IsNullOrEmpty(project.HelpFile) || _projects.Any(a => a.Key == project.HelpFile))
{
project.HelpFile = project.GetHashCode().ToString();
project.HelpFile = (project.GetHashCode() ^ project.HelpFile.GetHashCode()).ToString();
}

var projectId = project.HelpFile;
if (!_projects.ContainsKey(projectId))
{
Expand Down

0 comments on commit 70a49e9

Please sign in to comment.