Skip to content

Commit e5bfd8f

Browse files
author
Lifeng Lu
committed
Short-cut the function when all nodes are verified.
1 parent 982a902 commit e5bfd8f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Microsoft.VisualStudio.Threading/JoinableTaskDependencyGraph.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,10 @@ private static void ComputeSelfAndDescendentOrJoinedJobsAndRemainTasks(IJoinable
772772
foreach (KeyValuePair<IJoinableTaskDependent, int> item in dependencies)
773773
{
774774
ComputeSelfAndDescendentOrJoinedJobsAndRemainTasks(item.Key, reachableNodes, remainNodes);
775+
if (remainNodes.Count == 0)
776+
{
777+
return;
778+
}
775779
}
776780
}
777781
}

0 commit comments

Comments
 (0)