Skip to content

Commit

Permalink
Fix a bug with building Roslyn.
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillOsenkov committed May 23, 2016
1 parent c982cc7 commit 0065886
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/StructuredLogger/Construction/Construction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ private void CalculateTargetGraph(Project project)
{
if (t.Project == project)
{
t.DependsOnTargets = stringTable.Intern(string.Join(",", targetGraph.GetDependencies(t.Name)));
var dependencies = targetGraph.GetDependencies(t.Name);
if (dependencies != null && dependencies.Any())
{
t.DependsOnTargets = stringTable.Intern(string.Join(",", dependencies));
}
}
});
}
Expand Down
15 changes: 9 additions & 6 deletions src/StructuredLogger/Construction/TargetGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,20 @@ private void Calculate()

public string GetDependent(string target)
{
return dependents[target].FirstOrDefault();
}
HashSet<string> bucket;
if (dependents.TryGetValue(target, out bucket))
{
return bucket.FirstOrDefault();
}

public IEnumerable<string> GetDependents(string target)
{
return dependents[target];
return null;
}

public IEnumerable<string> GetDependencies(string target)
{
return dependencies[target];
HashSet<string> bucket;
dependencies.TryGetValue(target, out bucket);
return bucket ?? Enumerable.Empty<string>();
}

public IEnumerable<string> GetTargetClosure(string targetName)
Expand Down

0 comments on commit 0065886

Please sign in to comment.