mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile] Fix contains, split
This commit is contained in:
@@ -1258,7 +1258,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
{
|
{
|
||||||
if (_items.ContainsKey(key))
|
if (_items.ContainsKey(key))
|
||||||
{
|
{
|
||||||
contains = _items.ContainsKey(key);
|
contains = _items[key].Contains(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1328,9 +1328,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
lock (_items)
|
lock (_items)
|
||||||
{
|
|
||||||
// While the key is in the dictionary and the item is there, remove it
|
|
||||||
if (_items.ContainsKey(key) && _items[key].Contains(value))
|
|
||||||
{
|
{
|
||||||
// Remove the statistics first
|
// Remove the statistics first
|
||||||
_datStats.RemoveItem(value);
|
_datStats.RemoveItem(value);
|
||||||
@@ -1338,7 +1335,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
_items[key].Remove(value);
|
_items[key].Remove(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove a range of values from the file dictionary if they exists
|
/// Remove a range of values from the file dictionary if they exists
|
||||||
@@ -3004,8 +3000,11 @@ namespace SabreTools.Library.DatFiles
|
|||||||
foreach (DatItem item in parentItems)
|
foreach (DatItem item in parentItems)
|
||||||
{
|
{
|
||||||
DatItem datItem = (DatItem)item.Clone();
|
DatItem datItem = (DatItem)item.Clone();
|
||||||
|
while (this[game].Contains(datItem))
|
||||||
|
{
|
||||||
Remove(game, datItem);
|
Remove(game, datItem);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Now we want to get the parent romof tag and put it in each of the items
|
// Now we want to get the parent romof tag and put it in each of the items
|
||||||
List<DatItem> items = this[game];
|
List<DatItem> items = this[game];
|
||||||
|
|||||||
Reference in New Issue
Block a user