mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SimpleSort] This can be multithreaded...
This commit is contained in:
@@ -209,8 +209,9 @@ namespace SabreTools.Helper
|
||||
|
||||
// Create a list of just files from inputs
|
||||
List<string> files = new List<string>();
|
||||
foreach (string input in _inputs)
|
||||
{
|
||||
Parallel.ForEach(_inputs,
|
||||
new ParallelOptions { MaxDegreeOfParallelism = _maxDegreeOfParallelism, },
|
||||
input => {
|
||||
if (File.Exists(input))
|
||||
{
|
||||
_logger.Verbose("File found: '" + input + "'");
|
||||
@@ -219,17 +220,19 @@ namespace SabreTools.Helper
|
||||
else if (Directory.Exists(input))
|
||||
{
|
||||
_logger.Verbose("Directory found: '" + input + "'");
|
||||
foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories))
|
||||
Parallel.ForEach(Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories),
|
||||
new ParallelOptions { MaxDegreeOfParallelism = _maxDegreeOfParallelism, },
|
||||
file =>
|
||||
{
|
||||
_logger.Verbose("File found: '" + file + "'");
|
||||
files.Add(Path.GetFullPath(file));
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Error("'" + input + "' is not a file or directory!");
|
||||
}
|
||||
}
|
||||
});
|
||||
_logger.User("Retrieving complete in: " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
|
||||
|
||||
// Then, loop through and check each of the inputs
|
||||
|
||||
Reference in New Issue
Block a user