File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ public static class UTF8
127
127
const byte OVERLONG_4 = 1 << 6 ;
128
128
const byte CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS ;
129
129
130
- public unsafe static byte * GetPointerToFirstInvalidByte ( byte * pInputBuffer , int inputLength )
130
+ public unsafe static byte * GetPointerToFirstInvalidByteAvx2 ( byte * pInputBuffer , int inputLength )
131
131
{
132
132
int processedLength = 0 ;
133
133
@@ -303,7 +303,18 @@ public static class UTF8
303
303
304
304
return pInputBuffer + inputLength ;
305
305
}
306
- }
307
306
307
+ public unsafe static byte * GetPointerToFirstInvalidByte ( byte * pInputBuffer , int inputLength )
308
+ {
309
+ if ( Avx2 . IsSupported )
310
+ {
311
+ return GetPointerToFirstInvalidByteAvx2 ( pInputBuffer , inputLength ) ;
312
+ }
313
+ else
314
+ {
315
+ return GetPointerToFirstInvalidByteScalar ( pInputBuffer , inputLength ) ;
316
+ }
317
+ }
308
318
319
+ }
309
320
}
You can’t perform that action at this time.
0 commit comments