Don't cast everything

This commit is contained in:
Infi
2024-06-02 14:52:18 +02:00
parent 9c4b975605
commit 6ee209c1ad
+1 -1
View File
@@ -164,7 +164,7 @@ internal partial class Message
// Use as is if it's not a text chunk, it already has a payload, or is auto translate // Use as is if it's not a text chunk, it already has a payload, or is auto translate
if (chunk is not TextChunk text || chunk.Link != null || nextIsAutoTranslate) if (chunk is not TextChunk text || chunk.Link != null || nextIsAutoTranslate)
{ {
nextIsAutoTranslate = ((IconChunk)chunk).Icon == BitmapFontIcon.AutoTranslateBegin; nextIsAutoTranslate = chunk is IconChunk { Icon: BitmapFontIcon.AutoTranslateBegin };
// No need to call AddChunkWithMessage here since the chunk // No need to call AddChunkWithMessage here since the chunk
// already has the Message field set. // already has the Message field set.