Skip to content

Commit

Permalink
Drop some unreachable code in MimeReader.StepHeaders/Async()
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Dec 22, 2024
1 parent 654f318 commit 5161d3e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions MimeKit/AsyncMimeReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,6 @@ async Task StepHeadersAsync (CancellationToken cancellationToken)
await OnHeaderReadAsync (header, beginLineNumber, cancellationToken).ConfigureAwait (false);
} while (!eof);

if (state == MimeParserState.MessageHeaders || state == MimeParserState.Headers) {
// Ideally, we never get here. If we do, there's an exit in the loop above that should be fixed.
state = MimeParserState.Content;
}

headerBlockEnd = GetOffset (inputIndex);

await OnHeadersEndAsync (headerBlockBegin, headersBeginLineNumber, headerBlockEnd, lineNumber, cancellationToken).ConfigureAwait (false);
Expand Down
5 changes: 0 additions & 5 deletions MimeKit/MimeReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1798,11 +1798,6 @@ unsafe void StepHeaders (byte* inbuf, CancellationToken cancellationToken)
OnHeaderRead (header, beginLineNumber, cancellationToken);
} while (!eof);

if (state == MimeParserState.MessageHeaders || state == MimeParserState.Headers) {
// Ideally, we never get here. If we do, there's an exit in the loop above that should be fixed.
state = MimeParserState.Content;
}

headerBlockEnd = GetOffset (inputIndex);

OnHeadersEnd (headerBlockBegin, headersBeginLineNumber, headerBlockEnd, lineNumber, cancellationToken);
Expand Down

0 comments on commit 5161d3e

Please sign in to comment.