Change a couple string.Replace("a", "b") to string.Replace('a', 'b') (dotnet/coreclr...
authorStephen Toub <stoub@microsoft.com>
Thu, 3 Jan 2019 00:56:46 +0000 (19:56 -0500)
committerGitHub <noreply@github.com>
Thu, 3 Jan 2019 00:56:46 +0000 (19:56 -0500)
The latter is functionally the same but less overhead.

Commit migrated from https://github.com/dotnet/coreclr/commit/922971c5e2a0e74841218dbd8e00f6354ab2b98f

src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/Opcode.cs

index c8522b9..3dc1cb0 100644 (file)
@@ -5183,7 +5183,7 @@ namespace System.Diagnostics.Tracing
             if (dllName != null)
                 sb.Append("\" resourceFileName=\"").Append(dllName).Append("\" messageFileName=\"").Append(dllName);
 
-            var symbolsName = providerName.Replace("-", "").Replace(".", "_");  // Period and - are illegal replace them.
+            var symbolsName = providerName.Replace("-", "").Replace('.', '_');  // Period and - are illegal replace them.
             sb.Append("\" symbol=\"").Append(symbolsName);
             sb.Append("\">").AppendLine();
         }
index 1a144fc..fdac84f 100644 (file)
@@ -149,7 +149,7 @@ namespace System.Reflection.Emit
                     return name;
 
                 // Create ilasm style name from the enum value name.
-                name = Enum.GetName(typeof(OpCodeValues), opCodeValue).ToLowerInvariant().Replace("_", ".");
+                name = Enum.GetName(typeof(OpCodeValues), opCodeValue).ToLowerInvariant().Replace('_', '.');
                 Volatile.Write(ref nameCache[idx], name);
                 return name;
             }