@@ -81,16 +81,11 @@ public ArrayView(T[] array, int index)
8181 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
8282 public ArrayView ( T [ ] array , int index , int length )
8383 {
84- if ( IntPtr . Size == 8 )
85- {
86- if ( ( ulong ) ( uint ) index + ( uint ) length > ( uint ) array . Length )
87- ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
88- }
89- else
90- {
91- if ( ( uint ) index > ( uint ) array . Length || ( uint ) length > ( uint ) ( array . Length - index ) )
92- ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
93- }
84+ //
85+ // https://github.com/dotnet/runtime/issues/119689
86+ //
87+ if ( ( uint ) index > ( uint ) array . Length || ( uint ) length > ( uint ) ( array . Length - index ) )
88+ ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
9489
9590 _index = index ;
9691 _count = length ;
@@ -152,16 +147,8 @@ public ArrayView<T> Slice(int index)
152147 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
153148 public ArrayView < T > Slice ( int index , int count )
154149 {
155- if ( IntPtr . Size == 8 )
156- {
157- if ( ( ulong ) ( uint ) index + ( uint ) count > ( uint ) _count )
158- ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
159- }
160- else
161- {
162- if ( ( uint ) index > ( uint ) _count || ( uint ) count > ( uint ) ( _count - index ) )
163- ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
164- }
150+ if ( ( uint ) index > ( uint ) _count || ( uint ) count > ( uint ) ( _count - index ) )
151+ ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
165152
166153 return new ArrayView < T > ( _array ! , _index + index , count , unused : 0 ) ;
167154 }
0 commit comments