[DatFile] Add more security and comments

This commit is contained in:
Matt Nadareski
2016-09-20 14:41:45 -07:00
parent 5c34427c81
commit 9d25ad94b6

View File

@@ -2246,7 +2246,8 @@ namespace SabreTools.Helper
} }
// Process each all of the roms // Process each all of the roms
foreach (string key in dict.Keys) List<string> keys = dict.Keys.ToList();
foreach (string key in keys)
{ {
List<DatItem> roms = dict[key]; List<DatItem> roms = dict[key];
@@ -2257,11 +2258,13 @@ namespace SabreTools.Helper
continue; continue;
} }
// If we're merging the roms, do so
if (mergeroms) if (mergeroms)
{ {
roms = DatItem.Merge(roms, logger); roms = DatItem.Merge(roms, logger);
} }
// Now add each of the roms to their respective games
foreach (DatItem rom in roms) foreach (DatItem rom in roms)
{ {
count++; count++;
@@ -2286,7 +2289,7 @@ namespace SabreTools.Helper
} }
// Now go through and sort all of the lists // Now go through and sort all of the lists
List<string> keys = sortable.Keys.ToList(); keys = sortable.Keys.ToList();
foreach (string key in keys) foreach (string key in keys)
{ {
List<DatItem> sortedlist = sortable[key]; List<DatItem> sortedlist = sortable[key];