diff --git a/TwitchDownloaderCore/ChatRenderer.cs b/TwitchDownloaderCore/ChatRenderer.cs index 6d15de89..b15ba349 100644 --- a/TwitchDownloaderCore/ChatRenderer.cs +++ b/TwitchDownloaderCore/ChatRenderer.cs @@ -785,13 +785,15 @@ private void DrawEmojiMessage(List sectionImages, List<(Point, TwitchE StringBuilder nonEmojiBuffer = new(); while (enumerator.MoveNext()) { - // Old LINQ method. Leaving this for reference - //List emojiMatches = Emoji.All.Where(x => fragmentString.StartsWith(x.ToString()) && fragmentString.Contains(x.Sequence.AsString.Trim('\uFE0F'))).ToList(); - List emojiMatches = new List(); - foreach (var emoji in Emoji.All) + foreach (var emoji in Emoji.All.AsParallel().Where(emoji => ((string)enumerator.Current).StartsWith(emoji.Sequence.AsString))) { - if (((string)enumerator.Current).StartsWith(emoji.Sequence.AsString)) + if (emoji.Group != "Flags") + { + emojiMatches.Add(emoji); + continue; + } + if (((string)enumerator.Current).StartsWith(emoji.Sequence.AsString, StringComparison.Ordinal)) { emojiMatches.Add(emoji); }