From 6ee209c1adebd4ba5282986b85ca3dbdc65ca5f0 Mon Sep 17 00:00:00 2001 From: Infi Date: Sun, 2 Jun 2024 14:52:18 +0200 Subject: [PATCH] Don't cast everything --- ChatTwo/Message.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChatTwo/Message.cs b/ChatTwo/Message.cs index 4e4555f..aafcc0e 100755 --- a/ChatTwo/Message.cs +++ b/ChatTwo/Message.cs @@ -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 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 // already has the Message field set.