From 02cdfb53aedf0e72d9854afd960dddbee70ab772 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 6 Jan 2025 15:56:48 -0500 Subject: [PATCH] Simplify conditional source update --- SabreTools.DatItems/DatItem.cs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/SabreTools.DatItems/DatItem.cs b/SabreTools.DatItems/DatItem.cs index 7071ae27..6ac2045e 100644 --- a/SabreTools.DatItems/DatItem.cs +++ b/SabreTools.DatItems/DatItem.cs @@ -170,7 +170,6 @@ namespace SabreTools.DatItems /// Existing item to copy information from /// /// The cases when Source data is updated: - /// - Current source data is missing and the other item has a source /// - Current source data has an index higher than the other item /// public void ConditionalUpdateSource(DatItem item) @@ -179,19 +178,6 @@ namespace SabreTools.DatItems Source? selfSource = GetFieldValue(DatItem.SourceKey); Source? itemSource = item.GetFieldValue(DatItem.SourceKey); - // If both sources are missing, do nothing - if (selfSource == null && itemSource == null) - return; - - // Use the new source if missing - if (selfSource == null && itemSource != null) - { - SetFieldValue(DatItem.SourceKey, itemSource.Clone() as Source); - CopyMachineInformation(item); - SetName(item.GetName()); - return; - } - // If either source is missing if (selfSource == null || itemSource == null) return;