Replaced AsReadOnly property getters with regular properties

Should reduce allocations
This commit is contained in:
Diogo Trindade committed 2021-09-04 19:41:59 +01:00
1 parent 7ad7eaad89
commit 0b370f261c
21 files changed
+84 -42

No files matched your search

@@ -17,13 +17,14 @@ namespace Artemis.Core.LayerBrushes
protected LayerBrushProvider()
{
_layerBrushDescriptors = new List<LayerBrushDescriptor>();
LayerBrushDescriptors = new(_layerBrushDescriptors);
Disabled += OnDisabled;
}
/// <summary>
/// A read-only collection of all layer brushes added with <see cref="RegisterLayerBrushDescriptor{T}" />
/// </summary>
public ReadOnlyCollection<LayerBrushDescriptor> LayerBrushDescriptors => _layerBrushDescriptors.AsReadOnly();
public ReadOnlyCollection<LayerBrushDescriptor> LayerBrushDescriptors { get; }
/// <summary>
/// Registers a layer brush descriptor for a given layer brush, so that it appears in the UI.