@@ -1212,20 +1212,12 @@ unsafe bool StepByteOrderMark (byte* inbuf, CancellationToken cancellationToken)
1212
1212
1213
1213
static unsafe bool IsMboxMarker ( byte * text , bool allowMunged = false )
1214
1214
{
1215
- #if COMPARE_QWORD
1216
- const ulong FromMask = 0x000000FFFFFFFFFF ;
1217
- const ulong From = 0x000000206D6F7246 ;
1218
- ulong * qword = ( ulong * ) text ;
1219
-
1220
- return ( * qword & FromMask ) == From ;
1221
- #else
1222
1215
byte * inptr = text ;
1223
1216
1224
1217
if ( allowMunged && * inptr == ( byte ) '>' )
1225
1218
inptr ++ ;
1226
1219
1227
1220
return * inptr ++ == ( byte ) 'F' && * inptr ++ == ( byte ) 'r' && * inptr ++ == ( byte ) 'o' && * inptr ++ == ( byte ) 'm' && * inptr == ( byte ) ' ' ;
1228
- #endif
1229
1221
}
1230
1222
1231
1223
static unsafe bool IsMboxMarker ( byte [ ] text , bool allowMunged = false )
@@ -1486,56 +1478,10 @@ unsafe bool StepHeaderValue (byte* inbuf, ref bool midline)
1486
1478
1487
1479
* inend = ( byte ) '\n ' ;
1488
1480
1489
- #if false
1490
- if ( midline ) {
1491
- while ( * inptr != ( byte ) '\n ' )
1492
- inptr ++ ;
1493
-
1494
- if ( inptr < inend ) {
1495
- // Consume the newline and update our parse state.
1496
- inptr ++ ;
1497
-
1498
- index = ( int ) ( inptr - inbuf ) ;
1499
- IncrementLineNumber ( index ) ;
1500
-
1501
- midline = false ;
1502
- } else {
1503
- // We've reached the end of the input buffer.
1504
- }
1505
- }
1506
- #endif
1507
-
1508
1481
while ( inptr < inend && ( midline || IsBlank ( * inptr ) ) ) {
1509
1482
// TODO: unroll this loop?
1510
- #if FUNROLL_LOOPS
1511
- // Note: we can always depend on byte[] arrays being 4-byte aligned on 32bit and 64bit architectures
1512
- int alignment = ( index + 3 ) & ~ 3 ;
1513
- byte * aligned = inbuf + alignment ;
1514
- byte c = * aligned ;
1515
-
1516
- * aligned = ( byte ) '\n ' ;
1517
1483
while ( * inptr != ( byte ) '\n ' )
1518
1484
inptr ++ ;
1519
- * aligned = c ;
1520
-
1521
- if ( inptr == aligned && c != ( byte ) '\n ' ) {
1522
- // -funroll-loops, yippee ki-yay.
1523
- uint * dword = ( uint * ) inptr ;
1524
- uint mask ;
1525
-
1526
- do {
1527
- mask = * dword ++ ^ 0x0A0A0A0A ;
1528
- mask = ( ( mask - 0x01010101 ) & ( ~ mask & 0x80808080 ) ) ;
1529
- } while ( mask == 0 ) ;
1530
-
1531
- inptr = ( byte * ) ( dword - 1 ) ;
1532
- while ( * inptr != ( byte ) '\n ' )
1533
- inptr ++ ;
1534
- }
1535
- #else
1536
- while ( * inptr != ( byte ) '\n ' )
1537
- inptr ++ ;
1538
- #endif
1539
1485
1540
1486
if ( inptr == inend ) {
1541
1487
// We've reached the end of the input buffer, and we are currently in the middle of a line.
0 commit comments