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
127127 const byte OVERLONG_4 = 1 << 6 ;
128128 const byte CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS ;
129129
130- public unsafe static byte * GetPointerToFirstInvalidByte ( byte * pInputBuffer , int inputLength )
130+ public unsafe static byte * GetPointerToFirstInvalidByteAvx2 ( byte * pInputBuffer , int inputLength )
131131 {
132132 int processedLength = 0 ;
133133
@@ -303,7 +303,18 @@ public static class UTF8
303303
304304 return pInputBuffer + inputLength ;
305305 }
306- }
307306
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+ }
308318
319+ }
309320}
You can’t perform that action at this time.
0 commit comments