C#: Use is [not] null throughout in the extractor

This commit is contained in:
Tom Hvitved
2021-03-05 16:18:31 +01:00
parent 23d994a4b4
commit 63686b5c4e
104 changed files with 274 additions and 274 deletions

View File

@@ -27,7 +27,7 @@ namespace Semmle.Autobuild.CSharp
.SelectMany(p => Enumerators.Singleton(p).Concat(p.IncludedProjects))
.OfType<Project>()
.FirstOrDefault(p => !p.DotNetProject);
if (notDotNetProject != null)
if (notDotNetProject is not null)
{
builder.Log(Severity.Info, "Not using .NET Core because of incompatible project {0}", notDotNetProject);
return BuildScript.Failure;
@@ -103,7 +103,7 @@ namespace Semmle.Autobuild.CSharp
if (!compatibleClr)
{
if (env == null)
if (env is null)
env = new Dictionary<string, string>();
env.Add("UseSharedCompilation", "false");
}
@@ -266,7 +266,7 @@ Invoke-Command -ScriptBlock $ScriptBlock";
}
private static string DotNetCommand(IBuildActions actions, string? dotNetPath) =>
dotNetPath != null ? actions.PathCombine(dotNetPath, "dotnet") : "dotnet";
dotNetPath is not null ? actions.PathCombine(dotNetPath, "dotnet") : "dotnet";
private static BuildScript GetInfoCommand(IBuildActions actions, string? dotNetPath, IDictionary<string, string>? environment)
{