Reduce and pad IMC allocations and log allocations.

This commit is contained in:
Ottermandias 2025-01-20 17:14:13 +01:00
parent 8779f4b689
commit 0c8571fba9
6 changed files with 29 additions and 14 deletions

View file

@ -51,7 +51,6 @@ public sealed class ImcCache(MetaFileManager manager, ModCollection collection)
if (!_imcFiles.TryGetValue(path, out var pair))
pair = (new ImcFile(Manager, identifier), []);
if (!Apply(pair.Item1, identifier, entry))
return;

View file

@ -10,9 +10,9 @@ public struct ModCollectionIdentity(Guid id, LocalCollectionId localId)
public static readonly ModCollectionIdentity Empty = new(Guid.Empty, LocalCollectionId.Zero, EmptyCollectionName, 0);
public string Name { get; set; }
public Guid Id { get; } = id;
public LocalCollectionId LocalId { get; } = localId;
public string Name { get; set; } = string.Empty;
public Guid Id { get; } = id;
public LocalCollectionId LocalId { get; } = localId;
/// <summary> The index of the collection is set and kept up-to-date by the CollectionManager. </summary>
public int Index { get; internal set; }