mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile] One more parallel in stats
This commit is contained in:
@@ -286,20 +286,27 @@ namespace SabreTools.Helper.Dats
|
||||
|
||||
// Make sure we have all files
|
||||
List<Tuple<string, string>> newinputs = new List<Tuple<string, string>>(); // item, basepath
|
||||
foreach (string input in inputs)
|
||||
Parallel.ForEach(inputs, Globals.ParallelOptions, input =>
|
||||
{
|
||||
if (File.Exists(input))
|
||||
{
|
||||
lock (newinputs)
|
||||
{
|
||||
newinputs.Add(Tuple.Create(Path.GetFullPath(input), Path.GetDirectoryName(Path.GetFullPath(input))));
|
||||
}
|
||||
}
|
||||
if (Directory.Exists(input))
|
||||
{
|
||||
foreach (string file in Directory.GetFiles(input, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
lock (newinputs)
|
||||
{
|
||||
newinputs.Add(Tuple.Create(Path.GetFullPath(file), Path.GetFullPath(input)));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
newinputs = newinputs
|
||||
.OrderBy(i => Path.GetDirectoryName(i.Item1))
|
||||
.ThenBy(i => Path.GetFileName(i.Item1))
|
||||
|
||||
Reference in New Issue
Block a user