diff --git a/src/Compilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxList.WithLotsOfChildren.cs b/src/Compilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxList.WithLotsOfChildren.cs index 6f65f6bfc0641..b2c084dc326cb 100644 --- a/src/Compilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxList.WithLotsOfChildren.cs +++ b/src/Compilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxList.WithLotsOfChildren.cs @@ -52,7 +52,7 @@ public override int GetSlotOffset(int index) public override int FindSlotIndexContainingOffset(int offset) { Debug.Assert(offset >= 0 && offset < FullWidth); - int idx = Array.BinarySearch(_childOffsets, offset); + int idx = _childOffsets.BinarySearch(offset); return idx >= 0 ? idx : (~idx - 1); } diff --git a/src/Compilers/Core/Desktop/LargeEncodedText.cs b/src/Compilers/Core/Desktop/LargeEncodedText.cs index 89b1fc0c21a0e..a1daf50e4b54c 100644 --- a/src/Compilers/Core/Desktop/LargeEncodedText.cs +++ b/src/Compilers/Core/Desktop/LargeEncodedText.cs @@ -3,6 +3,7 @@ using System.IO; using System.Text; using System.Threading; +using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Text { @@ -109,7 +110,7 @@ private static bool IsBinary(char[] chunk) private int GetIndexFromPosition(int position) { // Binary search to find the chunk that contains the given position. - int idx = Array.BinarySearch(_chunkStartOffsets, position); + int idx = _chunkStartOffsets.BinarySearch(position); return idx >= 0 ? idx : (~idx - 1); } diff --git a/src/Compilers/VisualBasic/Portable/Syntax/InternalSyntax/SyntaxList.vb b/src/Compilers/VisualBasic/Portable/Syntax/InternalSyntax/SyntaxList.vb index 1c05284d1370a..cccfb125a203d 100644 --- a/src/Compilers/VisualBasic/Portable/Syntax/InternalSyntax/SyntaxList.vb +++ b/src/Compilers/VisualBasic/Portable/Syntax/InternalSyntax/SyntaxList.vb @@ -466,7 +466,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Syntax.InternalSyntax ''' Public Overrides Function FindSlotIndexContainingOffset(offset As Integer) As Integer Debug.Assert(offset >= 0 AndAlso offset < FullWidth) - Dim idx = Array.BinarySearch(_childOffsets, offset) + Dim idx = _childOffsets.BinarySearch(offset) Return If(idx >= 0, idx, (Not idx) - 1) End Function