Skip to content

Commit 20f4bfb

Browse files
authored
Merge pull request #1117 from SixLabors/optimization/branchless-block8x8-constructor
Removed unnecessary MemoryMarshal.Cast call
2 parents 07c16a5 + fb8b82d commit 20f4bfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ internal unsafe struct Block8x8 : IEquatable<Block8x8>
3535
public Block8x8(Span<short> coefficients)
3636
{
3737
ref byte selfRef = ref Unsafe.As<Block8x8, byte>(ref this);
38-
ref byte sourceRef = ref MemoryMarshal.GetReference(MemoryMarshal.Cast<short, byte>(coefficients));
38+
ref byte sourceRef = ref Unsafe.As<short, byte>(ref MemoryMarshal.GetReference(coefficients));
3939
Unsafe.CopyBlock(ref selfRef, ref sourceRef, Size * sizeof(short));
4040
}
4141

0 commit comments

Comments
 (0)