diff --git a/src/Compilers/CSharp/Portable/Parser/Lexer.cs b/src/Compilers/CSharp/Portable/Parser/Lexer.cs index c7f270cbf813f..7a259a01aef45 100644 --- a/src/Compilers/CSharp/Portable/Parser/Lexer.cs +++ b/src/Compilers/CSharp/Portable/Parser/Lexer.cs @@ -3057,7 +3057,7 @@ private void ScanXmlEntity(ref TokenInfo info) if (MatchesProductionForXmlChar(charValue)) { char lowSurrogate; - char highSurrogate = SlidingTextWindow.GetCharsFromUtf32(charValue, out lowSurrogate); + char highSurrogate = GetCharsFromUtf32(charValue, out lowSurrogate); _builder.Append(highSurrogate); if (lowSurrogate != SlidingTextWindow.InvalidCharacter) diff --git a/src/Compilers/CSharp/Portable/Parser/SlidingTextWindow.cs b/src/Compilers/CSharp/Portable/Parser/SlidingTextWindow.cs index 6e39642976469..b84c4d55b8f57 100644 --- a/src/Compilers/CSharp/Portable/Parser/SlidingTextWindow.cs +++ b/src/Compilers/CSharp/Portable/Parser/SlidingTextWindow.cs @@ -481,21 +481,6 @@ public string GetText(int position, int length, bool intern) } } - internal static char GetCharsFromUtf32(uint codepoint, out char lowSurrogate) - { - if (codepoint < (uint)0x00010000) - { - lowSurrogate = InvalidCharacter; - return (char)codepoint; - } - else - { - Debug.Assert(codepoint > 0x0000FFFF && codepoint <= 0x0010FFFF); - lowSurrogate = (char)((codepoint - 0x00010000) % 0x0400 + 0xDC00); - return (char)((codepoint - 0x00010000) / 0x0400 + 0xD800); - } - } - internal TestAccessor GetTestAccessor() => new TestAccessor(this);