File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,16 +81,8 @@ 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+ if ( ( uint ) index > ( uint ) array . Length || ( uint ) length > ( uint ) ( array . Length - index ) )
85+ ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
9486
9587 _index = index ;
9688 _count = length ;
@@ -152,16 +144,8 @@ public ArrayView<T> Slice(int index)
152144 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
153145 public ArrayView < T > Slice ( int index , int count )
154146 {
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- }
147+ if ( ( uint ) index > ( uint ) _count || ( uint ) count > ( uint ) ( _count - index ) )
148+ ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
165149
166150 return new ArrayView < T > ( _array ! , _index + index , count , unused : 0 ) ;
167151 }
Original file line number Diff line number Diff line change @@ -76,16 +76,8 @@ public StringView(string value, int index)
7676 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
7777 public StringView ( string value , int index , int length )
7878 {
79- if ( IntPtr . Size == 8 )
80- {
81- if ( ( ulong ) ( uint ) index + ( uint ) length > ( uint ) value . Length )
82- ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
83- }
84- else
85- {
86- if ( ( uint ) index > ( uint ) value . Length || ( uint ) length > ( uint ) ( value . Length - index ) )
87- ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
88- }
79+ if ( ( uint ) index > ( uint ) value . Length || ( uint ) length > ( uint ) ( value . Length - index ) )
80+ ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
8981
9082 _index = index ;
9183 _length = length ;
@@ -177,16 +169,8 @@ public StringView Slice(int start)
177169 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
178170 public StringView Slice ( int start , int length )
179171 {
180- if ( IntPtr . Size == 8 )
181- {
182- if ( ( ulong ) ( uint ) start + ( uint ) length > ( uint ) _length )
183- ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
184- }
185- else
186- {
187- if ( ( uint ) start > ( uint ) _length || ( uint ) length > ( uint ) ( _length - start ) )
188- ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
189- }
172+ if ( ( uint ) start > ( uint ) _length || ( uint ) length > ( uint ) ( _length - start ) )
173+ ThrowHelper . ThrowArgumentOutOfRangeException ( ) ;
190174
191175 return new StringView ( _value ! , _index + start , length , unused : 0 ) ;
192176 }
You can’t perform that action at this time.
0 commit comments