mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
IntersectWith should be UnionWith
This commit is contained in:
@@ -151,9 +151,9 @@ namespace SabreTools.DatFiles
|
|||||||
// Get the combined list of fields to remove
|
// Get the combined list of fields to remove
|
||||||
var fieldNames = new HashSet<string>();
|
var fieldNames = new HashSet<string>();
|
||||||
if (itemFieldNames.ContainsKey(itemType))
|
if (itemFieldNames.ContainsKey(itemType))
|
||||||
fieldNames.IntersectWith(itemFieldNames[itemType]);
|
fieldNames.UnionWith(itemFieldNames[itemType]);
|
||||||
if (itemFieldNames.ContainsKey("item"))
|
if (itemFieldNames.ContainsKey("item"))
|
||||||
fieldNames.IntersectWith(itemFieldNames["item"]);
|
fieldNames.UnionWith(itemFieldNames["item"]);
|
||||||
|
|
||||||
// If the field specifically contains Name, set it separately
|
// If the field specifically contains Name, set it separately
|
||||||
if (fieldNames.Contains(Models.Metadata.Rom.NameKey))
|
if (fieldNames.Contains(Models.Metadata.Rom.NameKey))
|
||||||
|
|||||||
@@ -1286,7 +1286,7 @@ namespace SabreTools.DatFiles
|
|||||||
if (devItems == null)
|
if (devItems == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
newDeviceReferences.IntersectWith(devItems
|
newDeviceReferences.UnionWith(devItems
|
||||||
.Where(i => i is DeviceRef)
|
.Where(i => i is DeviceRef)
|
||||||
.Select(i => (i as DeviceRef)!.GetName()!));
|
.Select(i => (i as DeviceRef)!.GetName()!));
|
||||||
|
|
||||||
@@ -1336,7 +1336,7 @@ namespace SabreTools.DatFiles
|
|||||||
if (slotItems == null)
|
if (slotItems == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
newSlotOptions.IntersectWith(slotItems
|
newSlotOptions.UnionWith(slotItems
|
||||||
.Where(i => i is Slot)
|
.Where(i => i is Slot)
|
||||||
.Where(s => (s as Slot)!.SlotOptionsSpecified)
|
.Where(s => (s as Slot)!.SlotOptionsSpecified)
|
||||||
.SelectMany(s => (s as Slot)!.GetFieldValue<SlotOption[]?>(Models.Metadata.Slot.SlotOptionKey)!)
|
.SelectMany(s => (s as Slot)!.GetFieldValue<SlotOption[]?>(Models.Metadata.Slot.SlotOptionKey)!)
|
||||||
|
|||||||
@@ -1716,7 +1716,7 @@ namespace SabreTools.DatFiles
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Add to the list of new device reference names
|
// Add to the list of new device reference names
|
||||||
newDeviceReferences.IntersectWith(devItems
|
newDeviceReferences.UnionWith(devItems
|
||||||
.Where(i => i.Item2 is DeviceRef)
|
.Where(i => i.Item2 is DeviceRef)
|
||||||
.Select(i => (i.Item2 as DeviceRef)!.GetName()!));
|
.Select(i => (i.Item2 as DeviceRef)!.GetName()!));
|
||||||
|
|
||||||
@@ -1771,7 +1771,7 @@ namespace SabreTools.DatFiles
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Add to the list of new slot option names
|
// Add to the list of new slot option names
|
||||||
newSlotOptions.IntersectWith(slotItems
|
newSlotOptions.UnionWith(slotItems
|
||||||
.Where(i => i.Item2 is Slot)
|
.Where(i => i.Item2 is Slot)
|
||||||
.Where(s => (s.Item2 as Slot)!.SlotOptionsSpecified)
|
.Where(s => (s.Item2 as Slot)!.SlotOptionsSpecified)
|
||||||
.SelectMany(s => (s.Item2 as Slot)!.GetFieldValue<SlotOption[]?>(Models.Metadata.Slot.SlotOptionKey)!)
|
.SelectMany(s => (s.Item2 as Slot)!.GetFieldValue<SlotOption[]?>(Models.Metadata.Slot.SlotOptionKey)!)
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ namespace SabreTools.DatTools
|
|||||||
// Get the combined list of fields to remove
|
// Get the combined list of fields to remove
|
||||||
var fieldNames = new HashSet<string>();
|
var fieldNames = new HashSet<string>();
|
||||||
if (itemFieldNames.ContainsKey(itemType))
|
if (itemFieldNames.ContainsKey(itemType))
|
||||||
fieldNames.IntersectWith(itemFieldNames[itemType]);
|
fieldNames.UnionWith(itemFieldNames[itemType]);
|
||||||
if (itemFieldNames.ContainsKey("item"))
|
if (itemFieldNames.ContainsKey("item"))
|
||||||
fieldNames.IntersectWith(itemFieldNames["item"]);
|
fieldNames.UnionWith(itemFieldNames["item"]);
|
||||||
|
|
||||||
// If the field specifically contains Name, set it separately
|
// If the field specifically contains Name, set it separately
|
||||||
if (fieldNames.Contains(Models.Metadata.Rom.NameKey))
|
if (fieldNames.Contains(Models.Metadata.Rom.NameKey))
|
||||||
|
|||||||
Reference in New Issue
Block a user