Skip to content

Commit

Permalink
Avoid ToLoverInvariant in string comparisons (CA1862)
Browse files Browse the repository at this point in the history
  • Loading branch information
BCSharp committed Dec 10, 2023
1 parent 7b478c3 commit bf098a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Src/Microsoft.Dynamic/DebugOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal static class DebugOptions {

private static bool ReadOption(string name) {
string envVar = ReadString(name);
return envVar != null && envVar.ToLowerInvariant() == "true";
return "true".Equals(envVar, StringComparison.InvariantCultureIgnoreCase);
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "name")]
Expand Down
3 changes: 2 additions & 1 deletion Src/Microsoft.Dynamic/Generation/AssemblyGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ private static void CopyDirectory(string to, string from) {
string toFile = Path.Combine(to, fi.Name);
FileInfo toInfo = new FileInfo(toFile);

if (fi.Extension.ToLowerInvariant() == ".dll" || fi.Extension.ToLowerInvariant() == ".exe") {
if (fi.Extension.Equals(".dll", StringComparison.InvariantCultureIgnoreCase)
|| fi.Extension.Equals(".exe", StringComparison.InvariantCultureIgnoreCase)) {
if (!File.Exists(toFile) || toInfo.CreationTime != fi.CreationTime) {
try {
File.Copy(filename, toFile, true);
Expand Down

0 comments on commit bf098a1

Please sign in to comment.