Skip to content

Commit 858a848

Browse files
committed
Reduced intermediate allocations: Jpeg
1 parent 31424c0 commit 858a848

File tree

4 files changed

+231
-208
lines changed

4 files changed

+231
-208
lines changed

src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private AdobeMarker(short dctEncodeVersion, short app14Flags0, short app14Flags1
6262
/// </summary>
6363
/// <param name="bytes">The byte array containing metadata to parse.</param>
6464
/// <param name="marker">The marker to return.</param>
65-
public static bool TryParse(byte[] bytes, out AdobeMarker marker)
65+
public static bool TryParse(ReadOnlySpan<byte> bytes, out AdobeMarker marker)
6666
{
6767
if (ProfileResolver.IsProfile(bytes, ProfileResolver.AdobeMarker))
6868
{

src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private JFifMarker(byte majorVersion, byte minorVersion, byte densityUnits, shor
6969
/// </summary>
7070
/// <param name="bytes">The byte array containing metadata to parse.</param>
7171
/// <param name="marker">The marker to return.</param>
72-
public static bool TryParse(byte[] bytes, out JFifMarker marker)
72+
public static bool TryParse(ReadOnlySpan<byte> bytes, out JFifMarker marker)
7373
{
7474
if (ProfileResolver.IsProfile(bytes, ProfileResolver.JFifMarker))
7575
{

0 commit comments

Comments
 (0)