mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Fix new (nullability) compiler warnings
This commit is contained in:
@@ -84,7 +84,7 @@ namespace Semmle.Autobuild.Shared
|
||||
/// </summary>
|
||||
/// <param name="sln">The solution file.</param>
|
||||
/// <returns>A compatible file, or throws an exception.</returns>
|
||||
public static VcVarsBatFile FindCompatibleVcVars(IBuildActions actions, ISolution sln) =>
|
||||
public static VcVarsBatFile? FindCompatibleVcVars(IBuildActions actions, ISolution sln) =>
|
||||
FindCompatibleVcVars(actions, sln.ToolsVersion.Major);
|
||||
|
||||
/// <summary>
|
||||
@@ -92,9 +92,9 @@ namespace Semmle.Autobuild.Shared
|
||||
/// </summary>
|
||||
/// <param name="targetVersion">The tools version.</param>
|
||||
/// <returns>A compatible file, or null.</returns>
|
||||
public static VcVarsBatFile FindCompatibleVcVars(IBuildActions actions, int targetVersion) =>
|
||||
targetVersion < 10 ?
|
||||
VcVarsAllBatFiles(actions).OrderByDescending(b => b.ToolsVersion).FirstOrDefault() :
|
||||
VcVarsAllBatFiles(actions).Where(b => b.ToolsVersion >= targetVersion).OrderBy(b => b.ToolsVersion).FirstOrDefault();
|
||||
public static VcVarsBatFile? FindCompatibleVcVars(IBuildActions actions, int targetVersion) =>
|
||||
targetVersion < 10
|
||||
? VcVarsAllBatFiles(actions).OrderByDescending(b => b.ToolsVersion).FirstOrDefault()
|
||||
: VcVarsAllBatFiles(actions).Where(b => b.ToolsVersion >= targetVersion).OrderBy(b => b.ToolsVersion).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user