From: Stephen Toub Date: Thu, 3 Jan 2019 13:50:00 +0000 (-0500) Subject: Remove substring allocation in MethodBase.AppendParameters (dotnet/coreclr#21770) X-Git-Tag: submit/tizen/20210909.063632~11030^2~2944 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be76ac447d8d10d2c3338d7266f1dce4938afec8;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Remove substring allocation in MethodBase.AppendParameters (dotnet/coreclr#21770) Commit migrated from https://github.com/dotnet/coreclr/commit/faf2acefa7d88a446f561b38740a72d8838440a5 --- diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/MethodBase.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/MethodBase.CoreCLR.cs index 8f3e909..4f65474 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/MethodBase.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/MethodBase.CoreCLR.cs @@ -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