Skip to content

Commit 49bb9d4

Browse files
committed
Added TODO comments about potentially unrolling loops
1 parent 658c8da commit 49bb9d4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

MimeKit/MimeReader.cs

+8
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,7 @@ unsafe bool StepMboxMarkerStart (byte* inbuf, ref bool midline)
12441244

12451245
if (midline) {
12461246
// we're in the middle of a line, so we need to scan for the end of the line
1247+
// TODO: unroll this loop?
12471248
while (*inptr != (byte) '\n')
12481249
inptr++;
12491250

@@ -1267,6 +1268,7 @@ unsafe bool StepMboxMarkerStart (byte* inbuf, ref bool midline)
12671268
}
12681269

12691270
// scan for the end of the line
1271+
// TODO: unroll this loop?
12701272
while (*inptr != (byte) '\n')
12711273
inptr++;
12721274

@@ -1296,6 +1298,7 @@ unsafe bool StepMboxMarker (byte* inbuf, out int count)
12961298
*inend = (byte) '\n';
12971299

12981300
// scan for the end of the line
1301+
// TODO: unroll this loop?
12991302
while (*inptr != (byte) '\n')
13001303
inptr++;
13011304

@@ -1503,6 +1506,7 @@ unsafe bool StepHeaderValue (byte* inbuf, ref bool midline)
15031506
#endif
15041507

15051508
while (inptr < inend && (midline || IsBlank (*inptr))) {
1509+
// TODO: unroll this loop?
15061510
#if FUNROLL_LOOPS
15071511
// Note: we can always depend on byte[] arrays being 4-byte aligned on 32bit and 64bit architectures
15081512
int alignment = (index + 3) & ~3;
@@ -1593,6 +1597,7 @@ unsafe bool TryCheckBoundaryWithinHeaderBlock (byte* inbuf)
15931597

15941598
*inend = (byte) '\n';
15951599

1600+
// TODO: unroll this loop?
15961601
while (*inptr != (byte) '\n')
15971602
inptr++;
15981603

@@ -1808,6 +1813,7 @@ unsafe bool InnerSkipLine (byte* inbuf, bool consumeNewLine)
18081813

18091814
*inend = (byte) '\n';
18101815

1816+
// TODO: unroll this loop?
18111817
while (*inptr != (byte) '\n')
18121818
inptr++;
18131819

@@ -1961,6 +1967,7 @@ unsafe bool FoundImmediateBoundary (byte* inbuf, bool final)
19611967

19621968
*inend = (byte) '\n';
19631969

1970+
// TODO: unroll this loop?
19641971
while (*inptr != (byte) '\n')
19651972
inptr++;
19661973

@@ -2183,6 +2190,7 @@ unsafe int ConstructMessagePart (byte* inbuf, int depth, CancellationToken cance
21832190

21842191
*inend = (byte) '\n';
21852192

2193+
// TODO: unroll this loop?
21862194
while (*inptr != (byte) '\n')
21872195
inptr++;
21882196

0 commit comments

Comments
 (0)