From 4e2897dd1c9a90968bb0aff63411de33b19644d4 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 21 Sep 2020 10:23:57 -0700 Subject: [PATCH] Tweak Extras INI parsing --- SabreTools.Library/Filtering/ExtraIniItem.cs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/SabreTools.Library/Filtering/ExtraIniItem.cs b/SabreTools.Library/Filtering/ExtraIniItem.cs index 57a852b2..851d8b35 100644 --- a/SabreTools.Library/Filtering/ExtraIniItem.cs +++ b/SabreTools.Library/Filtering/ExtraIniItem.cs @@ -50,21 +50,18 @@ namespace SabreTools.Library.Filtering // Otherwise, read the file to the end try { - ir.ReadNextLine(); while (!ir.EndOfStream) { + // Read in the next line and process + ir.ReadNextLine(); + // We don't care about whitespace or comments if (ir.RowType == IniRowType.None || ir.RowType == IniRowType.Comment) - { - ir.ReadNextLine(); continue; - } // If we have a section, just read it in if (ir.RowType == IniRowType.SectionHeader) { - ir.ReadNextLine(); - // If we've found the start of the extras, set the flag if (string.Equals(ir.Section, "ROOT_FOLDER", StringComparison.OrdinalIgnoreCase)) foundRootFolder = true; @@ -85,15 +82,6 @@ namespace SabreTools.Library.Filtering // Add the new mapping Mappings[key].Add(value); - - // Read the next line in - ir.ReadNextLine(); - } - - // Otherwise, just read the next line - else - { - ir.ReadNextLine(); } } }