PMap return swapped to array

This commit is contained in:
Justin Swanson 2019-12-03 15:13:29 -06:00
parent 095f43b67b
commit 4945f95066
5 changed files with 7 additions and 7 deletions

View File

@ -461,7 +461,7 @@ namespace Wabbajack.Common
}
}
public static List<TR> PMap<TI, TR>(this IEnumerable<TI> coll, WorkQueue queue, StatusUpdateTracker updateTracker,
public static TR[] PMap<TI, TR>(this IEnumerable<TI> coll, WorkQueue queue, StatusUpdateTracker updateTracker,
Func<TI, TR> f)
{
var cnt = 0;
@ -487,7 +487,7 @@ namespace Wabbajack.Common
}
public static List<TR> PMap<TI, TR>(this IEnumerable<TI> coll, WorkQueue queue,
public static TR[] PMap<TI, TR>(this IEnumerable<TI> coll, WorkQueue queue,
Func<TI, TR> f)
{
var colllst = coll.ToList();
@ -524,7 +524,7 @@ namespace Wabbajack.Common
if (t.IsFaulted)
throw t.Exception;
return t.Result;
}).ToList();
}).ToArray();
}
public static void PMap<TI>(this IEnumerable<TI> coll, WorkQueue queue, Action<TI> f)

View File

@ -39,7 +39,7 @@ namespace Wabbajack.Lib
public bool ShowReportWhenFinished { get; set; } = true;
public List<Archive> SelectedArchives = new List<Archive>();
public ICollection<Archive> SelectedArchives = new List<Archive>();
public List<Directive> InstallDirectives = new List<Directive>();
public List<RawSourceFile> AllFiles = new List<RawSourceFile>();
public ModList ModList = new ModList();

View File

@ -246,7 +246,7 @@ namespace Wabbajack.Lib
{
GameType = GameRegistry.Games.Values.First(f => f.MO2Name == MO2Ini.General.gameName).Game,
WabbajackVersion = WabbajackVersion,
Archives = SelectedArchives,
Archives = SelectedArchives.ToList(),
ModManager = ModManager.MO2,
Directives = InstallDirectives,
Name = ModListName ?? MO2Profile,

View File

@ -195,7 +195,7 @@ namespace Wabbajack.Lib
Readme = ModListReadme ?? "",
Image = ModListImage ?? "",
Website = ModListWebsite ?? "",
Archives = SelectedArchives,
Archives = SelectedArchives.ToList(),
ModManager = ModManager.Vortex,
Directives = InstallDirectives,
GameType = Game

View File

@ -373,7 +373,7 @@ namespace Wabbajack.VirtualFileSystem
public ImmutableDictionary<string, ImmutableStack<VirtualFile>> ByName { get; set; }
public ImmutableDictionary<string, VirtualFile> ByRootPath { get; }
public IndexRoot Integrate(List<VirtualFile> files)
public IndexRoot Integrate(ICollection<VirtualFile> files)
{
Utils.Log($"Integrating {files.Count} files");
var allFiles = AllFiles.Concat(files).GroupBy(f => f.Name).Select(g => g.Last()).ToImmutableList();