From 94f117c06f7209f7b56a0ae793b77882b3b7f898 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 13 Jan 2025 10:52:27 -0500 Subject: [PATCH] Remove unnecessary null skips --- SabreTools.DatFiles/DatFile.Splitting.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SabreTools.DatFiles/DatFile.Splitting.cs b/SabreTools.DatFiles/DatFile.Splitting.cs index 1138a75b..ca79ea01 100644 --- a/SabreTools.DatFiles/DatFile.Splitting.cs +++ b/SabreTools.DatFiles/DatFile.Splitting.cs @@ -235,7 +235,7 @@ namespace SabreTools.DatFiles } items = GetItemsForBucket(bucket); - foreach (DatItem item in items!) + foreach (DatItem item in items) { // Special disk handling if (item is Disk disk) @@ -827,7 +827,7 @@ namespace SabreTools.DatFiles // Now we want to get the parent romof tag and put it in each of the items items = GetItemsForBucket(bucket); string? romof = GetItemsForBucket(cloneOf!)![0].GetFieldValue(DatItem.MachineKey)!.GetStringFieldValue(Models.Metadata.Machine.RomOfKey); - foreach (DatItem item in items!) + foreach (DatItem item in items) { item.GetFieldValue(DatItem.MachineKey)!.SetFieldValue(Models.Metadata.Machine.RomOfKey, romof); } @@ -1103,7 +1103,7 @@ namespace SabreTools.DatFiles continue; // If the parent exists and has items, we remove the parent items from the current game - foreach (DatItem item in parentItems!) + foreach (DatItem item in parentItems) { DatItem datItem = (DatItem)item.Clone(); while (items.Contains(datItem)) @@ -1114,8 +1114,8 @@ namespace SabreTools.DatFiles // Now we want to get the parent romof tag and put it in each of the remaining items items = GetItemsForBucket(bucket); - string? romof = GetItemsForBucket(cloneOf!)![0].GetFieldValue(DatItem.MachineKey)!.GetStringFieldValue(Models.Metadata.Machine.RomOfKey); - foreach (DatItem item in items!) + string? romof = GetItemsForBucket(cloneOf)[0].GetFieldValue(DatItem.MachineKey)!.GetStringFieldValue(Models.Metadata.Machine.RomOfKey); + foreach (DatItem item in items) { item.GetFieldValue(DatItem.MachineKey)!.SetFieldValue(Models.Metadata.Machine.RomOfKey, romof); } @@ -1171,7 +1171,7 @@ namespace SabreTools.DatFiles continue; string? romof = machine.Value.GetStringFieldValue(Models.Metadata.Machine.RomOfKey); - foreach (var item in items!) + foreach (var item in items) { machine = ItemsDB.GetMachineForItem(item.Key); if (machine.Value == null)