mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-04-05 22:01:33 +00:00
A couple more small cleanup items
This commit is contained in:
@@ -332,10 +332,10 @@ namespace SabreTools.Metadata.DatFiles
|
||||
ClearEmptyKeys(partItems[partName]);
|
||||
|
||||
// If the item has a DataArea mapping
|
||||
if (dataAreaMappings.ContainsKey(partItem))
|
||||
if (dataAreaMappings.TryGetValue(partItem, out (Data.Models.Metadata.DataArea, Data.Models.Metadata.Rom) dataAreaMap))
|
||||
{
|
||||
// Get the mapped items
|
||||
var (dataArea, romItem) = dataAreaMappings[partItem];
|
||||
var (dataArea, romItem) = dataAreaMap;
|
||||
|
||||
// Clear any empty fields
|
||||
ClearEmptyKeys(romItem);
|
||||
@@ -389,10 +389,10 @@ namespace SabreTools.Metadata.DatFiles
|
||||
}
|
||||
|
||||
// If the item has a DiskArea mapping
|
||||
if (diskAreaMappings.ContainsKey(partItem))
|
||||
if (diskAreaMappings.TryGetValue(partItem, out (Data.Models.Metadata.DiskArea, Data.Models.Metadata.Disk) diskAreaMap))
|
||||
{
|
||||
// Get the mapped items
|
||||
var (diskArea, diskItem) = diskAreaMappings[partItem];
|
||||
var (diskArea, diskItem) = diskAreaMap;
|
||||
|
||||
// Clear any empty fields
|
||||
ClearEmptyKeys(diskItem);
|
||||
@@ -758,10 +758,10 @@ namespace SabreTools.Metadata.DatFiles
|
||||
ClearEmptyKeys(partItems[partName]);
|
||||
|
||||
// If the item has a DataArea mapping
|
||||
if (dataAreaMappings.ContainsKey(partItem))
|
||||
if (dataAreaMappings.TryGetValue(partItem, out (Data.Models.Metadata.DataArea, Data.Models.Metadata.Rom) dataAreaMap))
|
||||
{
|
||||
// Get the mapped items
|
||||
var (dataArea, romItem) = dataAreaMappings[partItem];
|
||||
var (dataArea, romItem) = dataAreaMap;
|
||||
|
||||
// Clear any empty fields
|
||||
ClearEmptyKeys(romItem);
|
||||
@@ -815,10 +815,10 @@ namespace SabreTools.Metadata.DatFiles
|
||||
}
|
||||
|
||||
// If the item has a DiskArea mapping
|
||||
if (diskAreaMappings.ContainsKey(partItem))
|
||||
if (diskAreaMappings.TryGetValue(partItem, out (Data.Models.Metadata.DiskArea, Data.Models.Metadata.Disk) diskAreaMap))
|
||||
{
|
||||
// Get the mapped items
|
||||
var (diskArea, diskItem) = diskAreaMappings[partItem];
|
||||
var (diskArea, diskItem) = diskAreaMap;
|
||||
|
||||
// Clear any empty fields
|
||||
ClearEmptyKeys(diskItem);
|
||||
|
||||
@@ -368,7 +368,11 @@ namespace SabreTools.Metadata.DatFiles
|
||||
public void BucketBy(ItemKey bucketBy, bool lower = true, bool norename = true)
|
||||
{
|
||||
// If we have a situation where there's no dictionary or no keys at all, we skip
|
||||
#if NET20 || NET35
|
||||
if (_items is null || _items.Count == 0)
|
||||
#else
|
||||
if (_items is null || _items.IsEmpty)
|
||||
#endif
|
||||
return;
|
||||
|
||||
// If the sorted type isn't the same, we want to sort the dictionary accordingly
|
||||
@@ -914,7 +918,11 @@ namespace SabreTools.Metadata.DatFiles
|
||||
DatStatistics.ResetStatistics();
|
||||
|
||||
// If we have a blank Dat in any way, return
|
||||
#if NET20 || NET35
|
||||
if (_items is null || _items.Count == 0)
|
||||
#else
|
||||
if (_items is null || _items.IsEmpty)
|
||||
#endif
|
||||
return;
|
||||
|
||||
// Loop through and add
|
||||
|
||||
@@ -1252,10 +1252,10 @@ namespace SabreTools.Metadata.DatFiles
|
||||
DatStatistics.ResetStatistics();
|
||||
|
||||
// If there are no items
|
||||
#if NET40_OR_GREATER || NETCOREAPP || NETSTANDARD2_0_OR_GREATER
|
||||
if (_items is null || _items.IsEmpty)
|
||||
#else
|
||||
#if NET20 || NET35
|
||||
if (_items is null || _items.Count == 0)
|
||||
#else
|
||||
if (_items is null || _items.IsEmpty)
|
||||
#endif
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user