Skip to content

Commit 99a2229

Browse files
committed
Fix new analyzer errors
1 parent 81a6878 commit 99a2229

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/tasks/Crossgen2Tasks/RunReadyToRunCompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
397397

398398
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
399399
{
400-
if (!ShowCompilerWarnings && singleLine.IndexOf("warning:", StringComparison.OrdinalIgnoreCase) != -1)
400+
if (!ShowCompilerWarnings && singleLine.Contains("warning:", StringComparison.OrdinalIgnoreCase))
401401
{
402402
Log.LogMessage(MessageImportance.Normal, singleLine);
403403
WarningsDetected = true;

src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private void UpdateAppRef(string sdkPath, string version)
274274
private string GetNuGetConfig()
275275
{
276276
string contents = File.ReadAllText(TemplateNuGetConfigPath);
277-
if (contents.IndexOf(s_nugetInsertionTag, StringComparison.InvariantCultureIgnoreCase) < 0)
277+
if (!contents.Contains(s_nugetInsertionTag, StringComparison.InvariantCultureIgnoreCase))
278278
throw new LogAsErrorException($"Could not find {s_nugetInsertionTag} in {TemplateNuGetConfigPath}");
279279

280280
return contents.Replace(s_nugetInsertionTag, $@"<add key=""nuget-local"" value=""{LocalNuGetsPath}"" />");
@@ -423,7 +423,7 @@ internal sealed record InstallWorkloadRequest(
423423
public string Version => Workload.GetMetadata("Version");
424424
public string TargetPath => Target.GetMetadata("InstallPath");
425425
public string StampPath => Target.GetMetadata("StampPath");
426-
public bool IgnoreErrors => Workload.GetMetadata("IgnoreErrors").ToLowerInvariant() == "true";
426+
public bool IgnoreErrors => Workload.GetMetadata("IgnoreErrors").Equals("true", StringComparison.InvariantCultureIgnoreCase);
427427
public string WorkloadId => Workload.ItemSpec;
428428

429429
public bool Validate(TaskLoggingHelper log)

0 commit comments

Comments
 (0)