diff --git a/PS2PatchElf/Program.cs b/PS2PatchElf/Program.cs index 7fd7e76..8c0f1b4 100644 --- a/PS2PatchElf/Program.cs +++ b/PS2PatchElf/Program.cs @@ -9,8 +9,7 @@ class Program { static void Main(string[] args) { - // PS2PatchElf by CaptainSwag101 - if (args.Length < 2 || args.Length > 3) + if (args.Length is not 2 or 3) { Console.WriteLine("Improper number of arguments specified.\nPlease pass an input ELF/SLUS, a PNACH file, and optionally the patched ELF/SLUS's output path, in that order!"); return; @@ -19,7 +18,7 @@ static void Main(string[] args) Elf? originalElf = ElfUtils.ParseElf(args[0]); // Final catch-all sanity check to ensure the ELF/SLUS file is valid - if (originalElf == null) + if (originalElf is null) { Console.WriteLine("Something went wrong while loading the ELF file."); return; diff --git a/PS2PatchLib/ElfUtils.cs b/PS2PatchLib/ElfUtils.cs index effdb99..0665bc9 100644 --- a/PS2PatchLib/ElfUtils.cs +++ b/PS2PatchLib/ElfUtils.cs @@ -129,7 +129,7 @@ public static class ElfUtils elf.SectionHeaders = new List(); for (int sh = 0; sh < elf.Header.SHNum; ++sh) { - + // We ignore these, I don't think they are necessary for PS2 ELF patching. } return elf; diff --git a/PS2PatchLib/PnachUtils.cs b/PS2PatchLib/PnachUtils.cs index d55baba..0d2149c 100644 --- a/PS2PatchLib/PnachUtils.cs +++ b/PS2PatchLib/PnachUtils.cs @@ -22,7 +22,7 @@ public static List ParseCheatFile(string pnachPath) using StreamReader reader = new(pnachPath); string? line; - while ((line = reader.ReadLine()?.ToLowerInvariant()) != null) + while ((line = reader.ReadLine()?.ToLowerInvariant()) is not null) { // We only care about cheat lines if (!line.StartsWith("patch"))