diff --git a/UndertaleModLib/Decompiler/Decompiler.cs b/UndertaleModLib/Decompiler/Decompiler.cs index 6bcddb389..4f2a21af6 100644 --- a/UndertaleModLib/Decompiler/Decompiler.cs +++ b/UndertaleModLib/Decompiler/Decompiler.cs @@ -3986,6 +3986,8 @@ public static void BuildSubFunctionCache(UndertaleData data) data.KnownSubFunctions = new Dictionary(); GlobalDecompileContext globalDecompileContext = new GlobalDecompileContext(data, false); + // TODO: Is this necessary? + // Doesn't the latter `Parallel.ForEach()` already cover this? foreach (var func in data.Functions) { if (func.Name.Content.StartsWith("gml_Script_")) diff --git a/UndertaleModTool/Editors/UndertaleCodeEditor.xaml.cs b/UndertaleModTool/Editors/UndertaleCodeEditor.xaml.cs index 0a5f3891b..a090923e3 100644 --- a/UndertaleModTool/Editors/UndertaleCodeEditor.xaml.cs +++ b/UndertaleModTool/Editors/UndertaleCodeEditor.xaml.cs @@ -714,16 +714,13 @@ private async Task DecompileCode(UndertaleCode code, bool first, LoaderDialog ex for (int i = 0; i < matches.Length; i++) { Match match = matches[i]; - if (match.Success) - { - if (currDict.TryGetValue(match.Groups[1].Value, out string text)) - { - if (i != matches.Length - 1) // if not the last - decompLinesBuilder.Append($"{text}; "); - else - decompLinesBuilder.Append(text + '\n'); - } - } + if (!currDict.TryGetValue(match.Groups[1].Value, out string text)) + continue; + + if (i != matches.Length - 1) // If not the last + decompLinesBuilder.Append($"{text}; "); + else + decompLinesBuilder.Append(text + '\n'); } } else