@@ -8,12 +8,14 @@ public static partial class SimdLinqExtensions
88 /// <summary>Compute Contains in SIMD.</summary>
99 public static unsafe bool Contains ( this byte [ ] source , byte value )
1010 {
11+ ArgumentNullException . ThrowIfNull ( source ) ;
1112 return ContainsCore ( new ReadOnlySpan < byte > ( source ) , value ) ;
1213 }
1314
1415 /// <summary>Compute Contains in SIMD.</summary>
1516 public static unsafe bool Contains ( this List < byte > source , byte value )
1617 {
18+ ArgumentNullException . ThrowIfNull ( source ) ;
1719 return ContainsCore ( ( ReadOnlySpan < byte > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
1820 }
1921
@@ -43,12 +45,14 @@ public static unsafe bool Contains(this ReadOnlySpan<byte> source, byte value)
4345 /// <summary>Compute Contains in SIMD.</summary>
4446 public static unsafe bool Contains ( this sbyte [ ] source , sbyte value )
4547 {
48+ ArgumentNullException . ThrowIfNull ( source ) ;
4649 return ContainsCore ( new ReadOnlySpan < sbyte > ( source ) , value ) ;
4750 }
4851
4952 /// <summary>Compute Contains in SIMD.</summary>
5053 public static unsafe bool Contains ( this List < sbyte > source , sbyte value )
5154 {
55+ ArgumentNullException . ThrowIfNull ( source ) ;
5256 return ContainsCore ( ( ReadOnlySpan < sbyte > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
5357 }
5458
@@ -78,12 +82,14 @@ public static unsafe bool Contains(this ReadOnlySpan<sbyte> source, sbyte value)
7882 /// <summary>Compute Contains in SIMD.</summary>
7983 public static unsafe bool Contains ( this short [ ] source , short value )
8084 {
85+ ArgumentNullException . ThrowIfNull ( source ) ;
8186 return ContainsCore ( new ReadOnlySpan < short > ( source ) , value ) ;
8287 }
8388
8489 /// <summary>Compute Contains in SIMD.</summary>
8590 public static unsafe bool Contains ( this List < short > source , short value )
8691 {
92+ ArgumentNullException . ThrowIfNull ( source ) ;
8793 return ContainsCore ( ( ReadOnlySpan < short > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
8894 }
8995
@@ -113,12 +119,14 @@ public static unsafe bool Contains(this ReadOnlySpan<short> source, short value)
113119 /// <summary>Compute Contains in SIMD.</summary>
114120 public static unsafe bool Contains ( this ushort [ ] source , ushort value )
115121 {
122+ ArgumentNullException . ThrowIfNull ( source ) ;
116123 return ContainsCore ( new ReadOnlySpan < ushort > ( source ) , value ) ;
117124 }
118125
119126 /// <summary>Compute Contains in SIMD.</summary>
120127 public static unsafe bool Contains ( this List < ushort > source , ushort value )
121128 {
129+ ArgumentNullException . ThrowIfNull ( source ) ;
122130 return ContainsCore ( ( ReadOnlySpan < ushort > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
123131 }
124132
@@ -148,12 +156,14 @@ public static unsafe bool Contains(this ReadOnlySpan<ushort> source, ushort valu
148156 /// <summary>Compute Contains in SIMD.</summary>
149157 public static unsafe bool Contains ( this int [ ] source , int value )
150158 {
159+ ArgumentNullException . ThrowIfNull ( source ) ;
151160 return ContainsCore ( new ReadOnlySpan < int > ( source ) , value ) ;
152161 }
153162
154163 /// <summary>Compute Contains in SIMD.</summary>
155164 public static unsafe bool Contains ( this List < int > source , int value )
156165 {
166+ ArgumentNullException . ThrowIfNull ( source ) ;
157167 return ContainsCore ( ( ReadOnlySpan < int > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
158168 }
159169
@@ -183,12 +193,14 @@ public static unsafe bool Contains(this ReadOnlySpan<int> source, int value)
183193 /// <summary>Compute Contains in SIMD.</summary>
184194 public static unsafe bool Contains ( this uint [ ] source , uint value )
185195 {
196+ ArgumentNullException . ThrowIfNull ( source ) ;
186197 return ContainsCore ( new ReadOnlySpan < uint > ( source ) , value ) ;
187198 }
188199
189200 /// <summary>Compute Contains in SIMD.</summary>
190201 public static unsafe bool Contains ( this List < uint > source , uint value )
191202 {
203+ ArgumentNullException . ThrowIfNull ( source ) ;
192204 return ContainsCore ( ( ReadOnlySpan < uint > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
193205 }
194206
@@ -218,12 +230,14 @@ public static unsafe bool Contains(this ReadOnlySpan<uint> source, uint value)
218230 /// <summary>Compute Contains in SIMD.</summary>
219231 public static unsafe bool Contains ( this long [ ] source , long value )
220232 {
233+ ArgumentNullException . ThrowIfNull ( source ) ;
221234 return ContainsCore ( new ReadOnlySpan < long > ( source ) , value ) ;
222235 }
223236
224237 /// <summary>Compute Contains in SIMD.</summary>
225238 public static unsafe bool Contains ( this List < long > source , long value )
226239 {
240+ ArgumentNullException . ThrowIfNull ( source ) ;
227241 return ContainsCore ( ( ReadOnlySpan < long > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
228242 }
229243
@@ -253,12 +267,14 @@ public static unsafe bool Contains(this ReadOnlySpan<long> source, long value)
253267 /// <summary>Compute Contains in SIMD.</summary>
254268 public static unsafe bool Contains ( this ulong [ ] source , ulong value )
255269 {
270+ ArgumentNullException . ThrowIfNull ( source ) ;
256271 return ContainsCore ( new ReadOnlySpan < ulong > ( source ) , value ) ;
257272 }
258273
259274 /// <summary>Compute Contains in SIMD.</summary>
260275 public static unsafe bool Contains ( this List < ulong > source , ulong value )
261276 {
277+ ArgumentNullException . ThrowIfNull ( source ) ;
262278 return ContainsCore ( ( ReadOnlySpan < ulong > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
263279 }
264280
@@ -288,12 +304,14 @@ public static unsafe bool Contains(this ReadOnlySpan<ulong> source, ulong value)
288304 /// <summary>Compute Contains in SIMD.</summary>
289305 public static unsafe bool Contains ( this float [ ] source , float value )
290306 {
307+ ArgumentNullException . ThrowIfNull ( source ) ;
291308 return ContainsCore ( new ReadOnlySpan < float > ( source ) , value ) ;
292309 }
293310
294311 /// <summary>Compute Contains in SIMD.</summary>
295312 public static unsafe bool Contains ( this List < float > source , float value )
296313 {
314+ ArgumentNullException . ThrowIfNull ( source ) ;
297315 return ContainsCore ( ( ReadOnlySpan < float > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
298316 }
299317
@@ -323,12 +341,14 @@ public static unsafe bool Contains(this ReadOnlySpan<float> source, float value)
323341 /// <summary>Compute Contains in SIMD.</summary>
324342 public static unsafe bool Contains ( this double [ ] source , double value )
325343 {
344+ ArgumentNullException . ThrowIfNull ( source ) ;
326345 return ContainsCore ( new ReadOnlySpan < double > ( source ) , value ) ;
327346 }
328347
329348 /// <summary>Compute Contains in SIMD.</summary>
330349 public static unsafe bool Contains ( this List < double > source , double value )
331350 {
351+ ArgumentNullException . ThrowIfNull ( source ) ;
332352 return ContainsCore ( ( ReadOnlySpan < double > ) CollectionsMarshal . AsSpan ( source ) , value ) ;
333353 }
334354
0 commit comments