mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-23 08:47:10 +02:00
Add missing "yield return" (#424)
This commit is contained in:
parent
67ec10feea
commit
decd37ce6d
7 changed files with 54 additions and 95 deletions
|
@ -357,7 +357,6 @@ namespace Ryujinx.HLE.HOS
|
|||
{
|
||||
string cheatName = DefaultCheatName;
|
||||
List<string> instructions = new();
|
||||
List<Cheat> cheats = new();
|
||||
|
||||
using StreamReader cheatData = cheatFile.OpenText();
|
||||
while (cheatData.ReadLine() is { } line)
|
||||
|
@ -373,13 +372,13 @@ namespace Ryujinx.HLE.HOS
|
|||
|
||||
Logger.Warning?.Print(LogClass.ModLoader, $"Ignoring cheat '{cheatFile.FullName}' because it is malformed");
|
||||
|
||||
return Array.Empty<Cheat>();
|
||||
yield break;
|
||||
}
|
||||
|
||||
// Add the previous section to the list.
|
||||
if (instructions.Count > 0)
|
||||
{
|
||||
cheats.Add(new Cheat($"<{cheatName} Cheat>", cheatFile, instructions));
|
||||
yield return new Cheat($"<{cheatName} Cheat>", cheatFile, instructions);
|
||||
}
|
||||
|
||||
// Start a new cheat section.
|
||||
|
@ -396,10 +395,8 @@ namespace Ryujinx.HLE.HOS
|
|||
// Add the last section being processed.
|
||||
if (instructions.Count > 0)
|
||||
{
|
||||
cheats.Add(new Cheat($"<{cheatName} Cheat>", cheatFile, instructions));
|
||||
yield return new Cheat($"<{cheatName} Cheat>", cheatFile, instructions);
|
||||
}
|
||||
|
||||
return cheats;
|
||||
}
|
||||
|
||||
// Assumes searchDirPaths don't overlap
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue