Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Png/PngDecoderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ private bool TryUncompressTextData(ReadOnlySpan<byte> compressedData, Encoding e
int bytesRead = inflateStream.CompressedStream.Read(this.buffer, 0, this.buffer.Length);
while (bytesRead != 0)
{
uncompressedBytes.AddRange(this.buffer.AsSpan().Slice(0, bytesRead).ToArray());
uncompressedBytes.AddRange(this.buffer.AsSpan(0, bytesRead).ToArray());
bytesRead = inflateStream.CompressedStream.Read(this.buffer, 0, this.buffer.Length);
}

Expand Down
2 changes: 1 addition & 1 deletion src/ImageSharp/Formats/Webp/WebpDecoderCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ private WebpImageInfo ReadVp8Header(WebpFeatures features = null)

// Check for VP8 magic bytes.
this.currentStream.Read(this.buffer, 0, 3);
if (!this.buffer.AsSpan().Slice(0, 3).SequenceEqual(WebpConstants.Vp8HeaderMagicBytes))
if (!this.buffer.AsSpan(0, 3).SequenceEqual(WebpConstants.Vp8HeaderMagicBytes))
{
WebpThrowHelper.ThrowImageFormatException("VP8 magic bytes not found");
}
Expand Down
4 changes: 2 additions & 2 deletions src/ImageSharp/IO/ChunkedMemoryStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public override int Read(byte[] buffer, int offset, int count)
const string bufferMessage = "Offset subtracted from the buffer length is less than count.";
Guard.IsFalse(buffer.Length - offset < count, nameof(buffer), bufferMessage);

return this.ReadImpl(buffer.AsSpan().Slice(offset, count));
return this.ReadImpl(buffer.AsSpan(offset, count));
}

#if SUPPORTS_SPAN_STREAM
Expand Down Expand Up @@ -359,7 +359,7 @@ public override void Write(byte[] buffer, int offset, int count)
const string bufferMessage = "Offset subtracted from the buffer length is less than count.";
Guard.IsFalse(buffer.Length - offset < count, nameof(buffer), bufferMessage);

this.WriteImpl(buffer.AsSpan().Slice(offset, count));
this.WriteImpl(buffer.AsSpan(offset, count));
}

#if SUPPORTS_SPAN_STREAM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private ResizeKernel BuildKernel<TResampler>(in TResampler sampler, int destRowI

ResizeKernel kernel = this.CreateKernel(dataRowIndex, left, right);

Span<double> kernelValues = this.tempValues.AsSpan().Slice(0, kernel.Length);
Span<double> kernelValues = this.tempValues.AsSpan(0, kernel.Length);
double sum = 0;

for (int j = left; j <= right; j++)
Expand Down