Skip to content

Commit

Permalink
Apply code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dsplaisted committed Apr 22, 2021
1 parent a1de9fd commit 77f444c
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver
// from the previous call, the cached state will be thrown out and recreated.
class CachingWorkloadResolver
{
private record CachedState
private sealed record CachedState
{
public string DotnetRootPath { get; init; }
public string SdkVersion { get; init; }
Expand All @@ -55,7 +55,7 @@ public CachedState()

public object _lockObject { get; } = new object();
private CachedState _cachedState;
private bool _enabled;
private readonly bool _enabled;


public CachingWorkloadResolver()
Expand All @@ -71,7 +71,7 @@ public CachingWorkloadResolver()
}
}

if (!_enabled)
if (_enabled)
{
string sentinelPath = Path.Combine(Path.GetDirectoryName(typeof(CachingWorkloadResolver).Assembly.Location), "DisableWorkloadResolver.sentinel");
if (File.Exists(sentinelPath))
Expand Down Expand Up @@ -101,20 +101,20 @@ public SdkResult ToSdkResult(SdkReference sdkReference, SdkResultFactory factory
}
}

public record SinglePathResolutionResult(
public sealed record SinglePathResolutionResult(
string Path
) : ResolutionResult;

public record MultiplePathResolutionResult(
public sealed record MultiplePathResolutionResult(
IEnumerable<string> Paths
) : ResolutionResult;

public record EmptyResolutionResult(
public sealed record EmptyResolutionResult(
IDictionary<string, string> propertiesToAdd,
IDictionary<string, SdkResultItem> itemsToAdd
) : ResolutionResult;

public record NullResolutionResult() : ResolutionResult;
public sealed record NullResolutionResult() : ResolutionResult;

private static ResolutionResult Resolve(string sdkReferenceName, IWorkloadManifestProvider manifestProvider, IWorkloadResolver workloadResolver)
{
Expand Down

0 comments on commit 77f444c

Please sign in to comment.