Some small fixes/improvements.

This commit is contained in:
Ottermandias 2023-05-27 13:56:43 +02:00
parent 96aaefd3e2
commit f938531e21
6 changed files with 13 additions and 16 deletions

View file

@ -325,17 +325,12 @@ public class CollectionCacheManager : IDisposable
/// </summary>
public void CreateNecessaryCaches()
{
var tasks = _active.SpecialAssignments.Select(p => p.Value)
Parallel.ForEach(_active.SpecialAssignments.Select(p => p.Value)
.Concat(_active.Individuals.Select(p => p.Collection))
.Prepend(_active.Current)
.Prepend(_active.Default)
.Prepend(_active.Interface)
.Where(CreateCache)
.Select(c => Task.Run(() => CalculateEffectiveFileListInternal(c)))
.ToArray();
Penumbra.Log.Debug($"Creating {tasks.Length} necessary caches.");
Task.WaitAll(tasks);
.Where(CreateCache), CalculateEffectiveFileListInternal);
}
private void OnModDiscoveryStarted()
@ -349,10 +344,7 @@ public class CollectionCacheManager : IDisposable
}
private void OnModDiscoveryFinished()
{
var tasks = Active.Select(c => Task.Run(() => CalculateEffectiveFileListInternal(c))).ToArray();
Task.WaitAll(tasks);
}
=> Parallel.ForEach(Active, CalculateEffectiveFileListInternal);
/// <summary>
/// Update forced files only on framework.