@@ -231,6 +231,52 @@ public static bool Compare(byte* arr, byte[] with, int len)
231
231
return Compare ( arr , ptr , len ) ;
232
232
}
233
233
234
+
235
+ [ MethImpl ( AggressiveInlining ) ]
236
+ public static bool Compare ( ReadOnlySpan < byte > arr , byte [ ] with , int len )
237
+ {
238
+ fixed ( void * withPtr = with )
239
+ fixed ( void * ptr = arr )
240
+ return Compare ( ptr , withPtr , len ) ;
241
+ }
242
+
243
+ [ MethImpl ( AggressiveInlining ) ]
244
+ public static bool Compare ( byte [ ] arr , ReadOnlySpan < byte > with )
245
+ {
246
+ fixed ( void * withPtr = with )
247
+ fixed ( void * ptr = arr )
248
+ return Compare ( ptr , withPtr , with . Length ) ;
249
+ }
250
+
251
+ [ MethImpl ( AggressiveInlining ) ]
252
+ public static bool Compare ( ReadOnlySpan < byte > arr , ReadOnlySpan < byte > with )
253
+ {
254
+ fixed ( void * withPtr = with )
255
+ fixed ( void * ptr = arr )
256
+ return Compare ( ptr , withPtr , with . Length ) ;
257
+ }
258
+
259
+ [ MethImpl ( AggressiveInlining ) ]
260
+ public static bool Compare ( void * ptr , ReadOnlySpan < byte > with )
261
+ {
262
+ fixed ( void * withPtr = with )
263
+ return Compare ( ptr , withPtr , with . Length ) ;
264
+ }
265
+
266
+ [ MethImpl ( AggressiveInlining ) ]
267
+ public static bool Compare ( ReadOnlySpan < byte > arr , byte * with , int len )
268
+ {
269
+ fixed ( void * ptr = arr )
270
+ return Compare ( ptr , with , len ) ;
271
+ }
272
+
273
+ [ MethImpl ( AggressiveInlining ) ]
274
+ public static bool Compare ( byte * arr , ReadOnlySpan < byte > with , int len )
275
+ {
276
+ fixed ( void * ptr = with )
277
+ return Compare ( arr , ptr , len ) ;
278
+ }
279
+
234
280
[ MethImpl ( AggressiveInlining ) ]
235
281
public static bool Contains < T > ( T * arr , int length , T val ) where T : unmanaged
236
282
{
0 commit comments