Browse Source

Merge pull request #1117 from SixLabors/optimization/branchless-block8x8-constructor

Removed unnecessary MemoryMarshal.Cast call
af/octree-no-pixelmap
Anton Firszov 6 years ago
committed by GitHub
parent
commit
d025f07998
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/ImageSharp/Formats/Jpeg/Components/Block8x8.cs

2
src/ImageSharp/Formats/Jpeg/Components/Block8x8.cs

@ -35,7 +35,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components
public Block8x8(Span<short> coefficients)
{
ref byte selfRef = ref Unsafe.As<Block8x8, byte>(ref this);
ref byte sourceRef = ref MemoryMarshal.GetReference(MemoryMarshal.Cast<short, byte>(coefficients));
ref byte sourceRef = ref Unsafe.As<short, byte>(ref MemoryMarshal.GetReference(coefficients));
Unsafe.CopyBlock(ref selfRef, ref sourceRef, Size * sizeof(short));
}

Loading…
Cancel
Save