Browse Source

Update src/ImageSharp/Common/Helpers/Numerics.cs

Co-authored-by: Clinton Ingram <clinton.ingram@outlook.com>
pull/2793/head
James Jackson-South 2 years ago
committed by GitHub
parent
commit
0594035f94
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      src/ImageSharp/Common/Helpers/Numerics.cs

8
src/ImageSharp/Common/Helpers/Numerics.cs

@ -1166,13 +1166,9 @@ internal static class Numerics
}
else
{
ref float startRef = ref MemoryMarshal.GetReference(span);
ref float endRef = ref Unsafe.Add(ref startRef, span.Length);
while (Unsafe.IsAddressLessThan(ref startRef, ref endRef))
for (int i = 0; i < span.Length; i++)
{
startRef /= sum;
startRef = ref Unsafe.Add(ref startRef, (nuint)1);
span[i] /= sum;
}
}
}

Loading…
Cancel
Save