Common DatItem properties can never be null

This commit is contained in:
Matt Nadareski
2025-01-10 21:52:21 -05:00
parent cfe7bb53e5
commit 20ec4edeb8
2 changed files with 3 additions and 6 deletions

View File

@@ -5,7 +5,6 @@ namespace SabreTools.DatFiles.Test
#region RemoveHeaderFields
// TODO: Write RemoveHeaderFields tests
// - Null header
// - Empty list
// - Full list
@@ -14,7 +13,6 @@ namespace SabreTools.DatFiles.Test
#region RemoveItemFields
// TODO: Write RemoveItemFields tests
// - Null item dict
// - Both lists empty
// - Machine only
// - Item only
@@ -25,7 +23,6 @@ namespace SabreTools.DatFiles.Test
#region RemoveItemFieldsDB
// TODO: Write RemoveItemFieldsDB tests
// - Null item dict
// - Both lists empty
// - Machine only
// - Item only

View File

@@ -18,7 +18,7 @@ namespace SabreTools.DatFiles
public void RemoveHeaderFields(List<string> headerFieldNames)
{
// If we have an invalid input, return
if (Header == null || headerFieldNames.Count == 0)
if (headerFieldNames.Count == 0)
return;
foreach (var fieldName in headerFieldNames)
@@ -34,7 +34,7 @@ namespace SabreTools.DatFiles
public void RemoveItemFields(List<string> machineFieldNames, Dictionary<string, List<string>> itemFieldNames)
{
// If we have an invalid input, return
if (Items == null || (machineFieldNames.Count == 0 && itemFieldNames.Count == 0))
if (machineFieldNames.Count == 0 && itemFieldNames.Count == 0)
return;
#if NET452_OR_GREATER || NETCOREAPP
@@ -70,7 +70,7 @@ namespace SabreTools.DatFiles
public void RemoveItemFieldsDB(List<string> machineFieldNames, Dictionary<string, List<string>> itemFieldNames)
{
// If we have an invalid input, return
if (ItemsDB == null || (machineFieldNames.Count == 0 && itemFieldNames.Count == 0))
if (machineFieldNames.Count == 0 && itemFieldNames.Count == 0)
return;
// Handle machine removals