From: Justin Van Patten Date: Thu, 26 Jan 2017 05:30:02 +0000 (-0800) Subject: Reduce number of branches and IL size of string.Trim methods (#9115) X-Git-Tag: accepted/tizen/base/20180629.140029~2491 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa3eac0956c70454d7f9768a58f4effb0482cc5b;p=platform%2Fupstream%2Fcoreclr.git Reduce number of branches and IL size of string.Trim methods (#9115) --- diff --git a/src/mscorlib/src/System/String.Manipulation.cs b/src/mscorlib/src/System/String.Manipulation.cs index 7b51abf..33de93f 100644 --- a/src/mscorlib/src/System/String.Manipulation.cs +++ b/src/mscorlib/src/System/String.Manipulation.cs @@ -1556,7 +1556,7 @@ namespace System { return TrimWhiteSpaceHelper(TrimType.Both); } - fixed (char* pTrimChars = trimChars) + fixed (char* pTrimChars = &trimChars[0]) { return TrimHelper(pTrimChars, trimChars.Length, TrimType.Both); } @@ -1575,7 +1575,7 @@ namespace System { return TrimWhiteSpaceHelper(TrimType.Head); } - fixed (char* pTrimChars = trimChars) + fixed (char* pTrimChars = &trimChars[0]) { return TrimHelper(pTrimChars, trimChars.Length, TrimType.Head); } @@ -1594,7 +1594,7 @@ namespace System { return TrimWhiteSpaceHelper(TrimType.Tail); } - fixed (char* pTrimChars = trimChars) + fixed (char* pTrimChars = &trimChars[0]) { return TrimHelper(pTrimChars, trimChars.Length, TrimType.Tail); }