Skip to content

Commit

Permalink
Remove unnecessary cast
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcarbon committed Jan 30, 2024
1 parent d16322f commit 8ac9951
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MimeKit/ParameterList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -896,16 +896,16 @@ static string DecodeRfc2231 (out Encoding encoding, ref Decoder decoder, HexDeco
if (TryGetCharset (text, ref index, endIndex, out string charset)) {
try {
encoding = CharsetUtils.GetEncoding (charset, "?");
decoder = (Decoder) encoding.GetDecoder ();
decoder = encoding.GetDecoder ();
} catch (NotSupportedException) {
encoding = Encoding.GetEncoding (28591); // iso-8859-1
decoder = (Decoder) encoding.GetDecoder ();
decoder = encoding.GetDecoder ();
}
} else {
// When no charset is specified, it should be safe to assume US-ASCII...
// but we all know what assume means, right??
encoding = Encoding.GetEncoding (28591); // iso-8859-1
decoder = (Decoder) encoding.GetDecoder ();
decoder = encoding.GetDecoder ();
}
} else {
encoding = null;
Expand Down

0 comments on commit 8ac9951

Please sign in to comment.