mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Added another missing PMap overload
This commit is contained in:
parent
afe0d2d875
commit
fb0bfe8e60
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.HashFunction.xxHash;
|
||||
using System.Diagnostics;
|
||||
@ -541,6 +541,18 @@ namespace Wabbajack.Common
|
||||
});
|
||||
}
|
||||
|
||||
public static async Task PMap<TI>(this IEnumerable<TI> coll, WorkQueue queue, StatusUpdateTracker updateTracker,
|
||||
Func<TI, Task> f)
|
||||
{
|
||||
var cnt = 0;
|
||||
var collist = coll.ToList();
|
||||
await collist.PMap(queue, async itm =>
|
||||
{
|
||||
updateTracker.MakeUpdate(collist.Count, Interlocked.Increment(ref cnt));
|
||||
await f(itm);
|
||||
});
|
||||
}
|
||||
|
||||
public static async Task PMap<TI>(this IEnumerable<TI> coll, WorkQueue queue, StatusUpdateTracker updateTracker,
|
||||
Action<TI> f)
|
||||
{
|
||||
@ -554,7 +566,6 @@ namespace Wabbajack.Common
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static async Task<TR[]> PMap<TI, TR>(this IEnumerable<TI> coll, WorkQueue queue,
|
||||
Func<TI, TR> f)
|
||||
{
|
||||
@ -592,7 +603,6 @@ namespace Wabbajack.Common
|
||||
return await Task.WhenAll(tasks);
|
||||
}
|
||||
|
||||
|
||||
public static async Task<TR[]> PMap<TI, TR>(this IEnumerable<TI> coll, WorkQueue queue,
|
||||
Func<TI, Task<TR>> f)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user