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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
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)); |
|
|
|
} |
|
|
|
|
|
|
|
|