Remove some allocations from resource tree.

This commit is contained in:
Ottermandias 2023-09-19 21:44:49 +02:00
parent 89c7095843
commit c29d0a5a4c
5 changed files with 39 additions and 33 deletions

View file

@ -37,7 +37,7 @@ public partial class ModCollection
public IEnumerable<Utf8GamePath> ReverseResolvePath(FullPath path)
=> _cache?.ReverseResolvePath(path) ?? Array.Empty<Utf8GamePath>();
public HashSet<Utf8GamePath>[] ReverseResolvePaths(string[] paths)
public HashSet<Utf8GamePath>[] ReverseResolvePaths(IReadOnlyCollection<string> paths)
=> _cache?.ReverseResolvePaths(paths) ?? paths.Select(_ => new HashSet<Utf8GamePath>()).ToArray();
public FullPath? ResolvePath(Utf8GamePath path)