Skip to content

Commit 45b019d

Browse files
committed
remove #pragma
1 parent 11d35fc commit 45b019d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Philips.CodeAnalysis.SecurityAnalyzers/LicenseAnalyzer.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
using System;
44
using System.Collections.Generic;
5+
using System.Globalization;
56
using System.IO;
67
using System.Linq;
78
using Microsoft.CodeAnalysis;
@@ -363,10 +364,7 @@ private static string ExtractLicenseFromUrl(string licenseUrl)
363364

364365
private static bool HasSubstringIgnoreCase(string source, string value)
365366
{
366-
#pragma warning disable CA2249 // Use IndexOf for cross-framework compatibility
367-
// Use IndexOf for compatibility across all target frameworks
368-
return source.IndexOf(value, StringComparison.OrdinalIgnoreCase) != -1;
369-
#pragma warning restore CA2249
367+
return source.ToUpper(CultureInfo.InvariantCulture).Contains(value.ToUpper(CultureInfo.InvariantCulture));
370368
}
371369

372370
private static bool IsLicenseAcceptable(string license, HashSet<string> allowedLicenses)

0 commit comments

Comments
 (0)