Remove substring allocation in MethodBase.AppendParameters (dotnet/coreclr#21770)
authorStephen Toub <stoub@microsoft.com>
Thu, 3 Jan 2019 13:50:00 +0000 (08:50 -0500)
committerJan Kotas <jkotas@microsoft.com>
Thu, 3 Jan 2019 13:50:00 +0000 (03:50 -1000)
Commit migrated from https://github.com/dotnet/coreclr/commit/faf2acefa7d88a446f561b38740a72d8838440a5

src/coreclr/src/System.Private.CoreLib/src/System/Reflection/MethodBase.CoreCLR.cs

index 8f3e909..4f65474 100644 (file)
@@ -72,7 +72,7 @@ namespace System.Reflection
                 // Why don't we just use "&"?
                 if (t.IsByRef)
                 {
-                    sbParamList.Append(typeName.TrimEnd('&'));
+                    sbParamList.Append(typeName.AsSpan().TrimEnd('&'));
                     sbParamList.Append(" ByRef");
                 }
                 else