mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add stopwatches to Filter as well
This commit is contained in:
@@ -96,6 +96,8 @@ namespace SabreTools.Filtering
|
|||||||
if (filters == null || filters.Count == 0)
|
if (filters == null || filters.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
InternalStopwatch watch = new InternalStopwatch("Populating filters from list");
|
||||||
|
|
||||||
foreach (string filterPair in filters)
|
foreach (string filterPair in filters)
|
||||||
{
|
{
|
||||||
(string field, string value, bool negate) = ProcessFilterPair(filterPair);
|
(string field, string value, bool negate) = ProcessFilterPair(filterPair);
|
||||||
@@ -123,6 +125,8 @@ namespace SabreTools.Filtering
|
|||||||
// If we didn't match anything, log an error
|
// If we didn't match anything, log an error
|
||||||
logger.Warning($"The value {field} did not match any filterable field names. Please check the wiki for more details on supported field names.");
|
logger.Warning($"The value {field} did not match any filterable field names. Please check the wiki for more details on supported field names.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -372,6 +376,8 @@ namespace SabreTools.Filtering
|
|||||||
if (MachineFilter == null || DatItemFilter == null)
|
if (MachineFilter == null || DatItemFilter == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
InternalStopwatch watch = new InternalStopwatch("Applying filters to DAT");
|
||||||
|
|
||||||
// If we're filtering per machine, bucket by machine first
|
// If we're filtering per machine, bucket by machine first
|
||||||
if (perMachine)
|
if (perMachine)
|
||||||
datFile.Items.BucketBy(ItemKey.Machine, DedupeType.None);
|
datFile.Items.BucketBy(ItemKey.Machine, DedupeType.None);
|
||||||
@@ -427,6 +433,10 @@ namespace SabreTools.Filtering
|
|||||||
logger.Error(ex);
|
logger.Error(ex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
watch.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ namespace SabreTools.Filtering
|
|||||||
if (DatHeaderRemover == null && DatItemRemover == null)
|
if (DatHeaderRemover == null && DatItemRemover == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Output the logging statement
|
|
||||||
InternalStopwatch watch = new InternalStopwatch("Applying removals to DAT");
|
InternalStopwatch watch = new InternalStopwatch("Applying removals to DAT");
|
||||||
|
|
||||||
// Remove DatHeader fields
|
// Remove DatHeader fields
|
||||||
|
|||||||
Reference in New Issue
Block a user