mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 13:06:24 +00:00
Fixed potential performance issue with for-loops when Spans are passed by reference
This commit is contained in:
1 parent
5f71ffdf1f
commit
f21acbd767
36 files changed
+40
-40
No files matched your search
@@ -18,7 +18,7 @@ public sealed class AverageByteSampler : ISampler<byte>
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public unsafe void Sample(in SamplerInfo<byte> info, in Span<byte> pixelData)
|
||||
public unsafe void Sample(in SamplerInfo<byte> info, Span<byte> pixelData)
|
||||
{
|
||||
int count = info.Width * info.Height;
|
||||
if (count == 0) return;
|
||||
|
||||
@@ -12,7 +12,7 @@ public sealed class AverageFloatSampler : ISampler<float>
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public unsafe void Sample(in SamplerInfo<float> info, in Span<float> pixelData)
|
||||
public unsafe void Sample(in SamplerInfo<float> info, Span<float> pixelData)
|
||||
{
|
||||
int count = info.Width * info.Height;
|
||||
if (count == 0) return;
|
||||
|
||||
Reference in new issue
Block a user