mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 01:58:30 +00:00
Removed allocation when applying decorators
This commit is contained in:
parent
93cd8055a2
commit
acddfed2b1
@ -74,9 +74,13 @@ public abstract class AbstractBrush : AbstractDecoratable<IBrushDecorator>, IBru
|
|||||||
if (Decorators.Count == 0) return;
|
if (Decorators.Count == 0) return;
|
||||||
|
|
||||||
lock (Decorators)
|
lock (Decorators)
|
||||||
foreach (IBrushDecorator decorator in Decorators)
|
// ReSharper disable once ForCanBeConvertedToForeach - Sadly this does not get optimized reliably and causes allocations if foreached
|
||||||
|
for (int i = 0; i < Decorators.Count; i++)
|
||||||
|
{
|
||||||
|
IBrushDecorator decorator = Decorators[i];
|
||||||
if (decorator.IsEnabled)
|
if (decorator.IsEnabled)
|
||||||
decorator.ManipulateColor(rectangle, renderTarget, ref color);
|
decorator.ManipulateColor(rectangle, renderTarget, ref color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user