mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 04:34:19 +01:00
Fix some ToDos, parallelization problems.
This commit is contained in:
parent
0ed94676ed
commit
8ea6893fc3
15 changed files with 50 additions and 41 deletions
|
|
@ -138,6 +138,9 @@ public sealed class ItemData : DataSharer, IReadOnlyDictionary<FullEquipType, IR
|
|||
public IEnumerable<(uint, EquipItem)> AllItems(bool main)
|
||||
=> (main ? _mainItems : _offItems).Select(i => (i.Key, (EquipItem)i.Value));
|
||||
|
||||
public int TotalItemCount(bool main)
|
||||
=> main ? _mainItems.Count : _offItems.Count;
|
||||
|
||||
public bool TryGetValue(uint key, bool main, out EquipItem value)
|
||||
{
|
||||
var dict = main ? _mainItems : _offItems;
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ internal sealed class ObjectIdentification : DataSharer, IObjectIdentifier
|
|||
|
||||
var options = new ParallelOptions()
|
||||
{
|
||||
MaxDegreeOfParallelism = Environment.ProcessorCount / 2,
|
||||
MaxDegreeOfParallelism = Math.Max(1, Environment.ProcessorCount / 2),
|
||||
};
|
||||
|
||||
Parallel.ForEach(gameData.GetExcelSheet<BNpcBase>(language)!.Where(b => b.RowId < BnpcNames.Count), options, bNpc =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue