[DatFile] Parallel hunting

This commit is contained in:
Matt Nadareski
2017-03-18 21:26:50 -07:00
parent c9c532776b
commit 23c5d9601d
8 changed files with 381 additions and 333 deletions

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using SabreTools.Helper.Data;
@@ -134,7 +135,8 @@ namespace SabreTools.Helper.Dats
List<string> keys = Keys.ToList();
keys.Sort(new NaturalComparer());
foreach (DatFormat datFormat in outfiles.Keys)
// Write out all required formats
Parallel.ForEach(outfiles.Keys, Globals.ParallelOptions, datFormat =>
{
string outfile = outfiles[datFormat];
@@ -229,7 +231,7 @@ namespace SabreTools.Helper.Dats
Globals.Logger.Verbose("File written!" + Environment.NewLine);
sw.Dispose();
fs.Dispose();
}
});
}
catch (Exception ex)
{