mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Prevented unnecessary allocations
This commit is contained in:
parent
e332d79a47
commit
6974203e34
@ -14,13 +14,18 @@ namespace RGB.NET.Core
|
|||||||
private readonly List<T> _decorators = new();
|
private readonly List<T> _decorators = new();
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IReadOnlyCollection<T> Decorators
|
public IReadOnlyCollection<T> Decorators { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="AbstractDecoratable{T}"/> class.
|
||||||
|
/// </summary>
|
||||||
|
protected AbstractDecoratable()
|
||||||
{
|
{
|
||||||
get
|
Decorators = new ReadOnlyCollection<T>(_decorators);
|
||||||
{
|
|
||||||
lock (_decorators)
|
|
||||||
return new ReadOnlyCollection<T>(_decorators);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user