@@ -125,9 +125,6 @@ public ReadOnlyMemory2D(string text, int offset, int height, int width, int pitc
125
125
/// <param name="array">The target array to wrap.</param>
126
126
/// <param name="height">The height of the resulting 2D area.</param>
127
127
/// <param name="width">The width of each row in the resulting 2D area.</param>
128
- /// <exception cref="ArrayTypeMismatchException">
129
- /// Thrown when <paramref name="array"/> doesn't match <typeparamref name="T"/>.
130
- /// </exception>
131
128
/// <exception cref="ArgumentException">
132
129
/// Thrown when either <paramref name="height"/> or <paramref name="width"/> are invalid.
133
130
/// </exception>
@@ -145,9 +142,6 @@ public ReadOnlyMemory2D(T[] array, int height, int width)
145
142
/// <param name="height">The height of the resulting 2D area.</param>
146
143
/// <param name="width">The width of each row in the resulting 2D area.</param>
147
144
/// <param name="pitch">The pitch in the resulting 2D area.</param>
148
- /// <exception cref="ArrayTypeMismatchException">
149
- /// Thrown when <paramref name="array"/> doesn't match <typeparamref name="T"/>.
150
- /// </exception>
151
145
/// <exception cref="ArgumentOutOfRangeException">
152
146
/// Thrown when one of the input parameters is out of range.
153
147
/// </exception>
@@ -156,11 +150,6 @@ public ReadOnlyMemory2D(T[] array, int height, int width)
156
150
/// </exception>
157
151
public ReadOnlyMemory2D ( T [ ] array , int offset , int height , int width , int pitch )
158
152
{
159
- if ( array . IsCovariant ( ) )
160
- {
161
- ThrowHelper . ThrowArrayTypeMismatchException ( ) ;
162
- }
163
-
164
153
if ( ( uint ) offset > ( uint ) array . Length )
165
154
{
166
155
ThrowHelper . ThrowArgumentOutOfRangeExceptionForOffset ( ) ;
@@ -201,9 +190,6 @@ public ReadOnlyMemory2D(T[] array, int offset, int height, int width, int pitch)
201
190
/// Initializes a new instance of the <see cref="ReadOnlyMemory2D{T}"/> struct wrapping a 2D array.
202
191
/// </summary>
203
192
/// <param name="array">The given 2D array to wrap.</param>
204
- /// <exception cref="ArrayTypeMismatchException">
205
- /// Thrown when <paramref name="array"/> doesn't match <typeparamref name="T"/>.
206
- /// </exception>
207
193
public ReadOnlyMemory2D ( T [ , ] ? array )
208
194
{
209
195
if ( array is null )
@@ -213,11 +199,6 @@ public ReadOnlyMemory2D(T[,]? array)
213
199
return ;
214
200
}
215
201
216
- if ( array . IsCovariant ( ) )
217
- {
218
- ThrowHelper . ThrowArrayTypeMismatchException ( ) ;
219
- }
220
-
221
202
this . instance = array ;
222
203
this . offset = GetArray2DDataByteOffset < T > ( ) ;
223
204
this . height = array . GetLength ( 0 ) ;
@@ -233,9 +214,6 @@ public ReadOnlyMemory2D(T[,]? array)
233
214
/// <param name="column">The target column to map within <paramref name="array"/>.</param>
234
215
/// <param name="height">The height to map within <paramref name="array"/>.</param>
235
216
/// <param name="width">The width to map within <paramref name="array"/>.</param>
236
- /// <exception cref="ArrayTypeMismatchException">
237
- /// Thrown when <paramref name="array"/> doesn't match <typeparamref name="T"/>.
238
- /// </exception>
239
217
/// <exception cref="ArgumentOutOfRangeException">
240
218
/// Thrown when either <paramref name="height"/>, <paramref name="width"/> or <paramref name="height"/>
241
219
/// are negative or not within the bounds that are valid for <paramref name="array"/>.
@@ -254,11 +232,6 @@ public ReadOnlyMemory2D(T[,]? array, int row, int column, int height, int width)
254
232
return ;
255
233
}
256
234
257
- if ( array . IsCovariant ( ) )
258
- {
259
- ThrowHelper . ThrowArrayTypeMismatchException ( ) ;
260
- }
261
-
262
235
int
263
236
rows = array . GetLength ( 0 ) ,
264
237
columns = array . GetLength ( 1 ) ;
@@ -295,17 +268,9 @@ public ReadOnlyMemory2D(T[,]? array, int row, int column, int height, int width)
295
268
/// </summary>
296
269
/// <param name="array">The given 3D array to wrap.</param>
297
270
/// <param name="depth">The target layer to map within <paramref name="array"/>.</param>
298
- /// <exception cref="ArrayTypeMismatchException">
299
- /// Thrown when <paramref name="array"/> doesn't match <typeparamref name="T"/>.
300
- /// </exception>
301
271
/// <exception cref="ArgumentOutOfRangeException">Thrown when a parameter is invalid.</exception>
302
272
public ReadOnlyMemory2D ( T [ , , ] array , int depth )
303
273
{
304
- if ( array . IsCovariant ( ) )
305
- {
306
- ThrowHelper . ThrowArrayTypeMismatchException ( ) ;
307
- }
308
-
309
274
if ( ( uint ) depth >= ( uint ) array . GetLength ( 0 ) )
310
275
{
311
276
ThrowHelper . ThrowArgumentOutOfRangeExceptionForDepth ( ) ;
@@ -327,17 +292,9 @@ public ReadOnlyMemory2D(T[,,] array, int depth)
327
292
/// <param name="column">The target column to map within <paramref name="array"/>.</param>
328
293
/// <param name="height">The height to map within <paramref name="array"/>.</param>
329
294
/// <param name="width">The width to map within <paramref name="array"/>.</param>
330
- /// <exception cref="ArrayTypeMismatchException">
331
- /// Thrown when <paramref name="array"/> doesn't match <typeparamref name="T"/>.
332
- /// </exception>
333
295
/// <exception cref="ArgumentOutOfRangeException">Thrown when a parameter is invalid.</exception>
334
296
public ReadOnlyMemory2D ( T [ , , ] array , int depth , int row , int column , int height , int width )
335
297
{
336
- if ( array . IsCovariant ( ) )
337
- {
338
- ThrowHelper . ThrowArrayTypeMismatchException ( ) ;
339
- }
340
-
341
298
if ( ( uint ) depth >= ( uint ) array . GetLength ( 0 ) )
342
299
{
343
300
ThrowHelper . ThrowArgumentOutOfRangeExceptionForDepth ( ) ;
0 commit comments