Skip to content

Commit

Permalink
Merge pull request #53723 from jasonmalinowski/check-invariants-in-de…
Browse files Browse the repository at this point in the history
…bug-only

Don't validate workspace invariants in release builds
  • Loading branch information
jasonmalinowski authored Jun 1, 2021
2 parents 0addecf + 1f902ca commit 0de95bb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ public SolutionState WithNewWorkspace(Workspace workspace, int workspaceVersion)
/// </summary>
public IReadOnlyList<ProjectId> ProjectIds { get; }

// [Conditional("DEBUG")]
// Only run this in debug builds; even the .Any() call across all projects can be expensive when there's a lot of them.
[Conditional("DEBUG")]
private void CheckInvariants()
{
Contract.ThrowIfFalse(_projectIdToProjectStateMap.Count == ProjectIds.Count);
Expand Down

0 comments on commit 0de95bb

Please sign in to comment.