Browse Source

Remove excess clearing

pull/1570/head
Ildar Khayrutdinov 5 years ago
parent
commit
60dcaac076
  1. 1
      src/ImageSharp/Formats/Tiff/Compression/Compressors/PackBitsCompressor.cs
  2. 2
      src/ImageSharp/Formats/Tiff/Writers/TiffBiColorWriter.cs

1
src/ImageSharp/Formats/Tiff/Compression/Compressors/PackBitsCompressor.cs

@ -29,7 +29,6 @@ namespace SixLabors.ImageSharp.Formats.Experimental.Tiff.Compression.Compressors
DebugGuard.IsTrue(rows.Length % height == 0, "Invalid height"); DebugGuard.IsTrue(rows.Length % height == 0, "Invalid height");
DebugGuard.IsTrue(this.BytesPerRow == rows.Length / height, "The widths must match"); DebugGuard.IsTrue(this.BytesPerRow == rows.Length / height, "The widths must match");
this.pixelData.Clear();
Span<byte> span = this.pixelData.GetSpan(); Span<byte> span = this.pixelData.GetSpan();
for (int i = 0; i < height; i++) for (int i = 0; i < height; i++)
{ {

2
src/ImageSharp/Formats/Tiff/Writers/TiffBiColorWriter.cs

@ -41,8 +41,6 @@ namespace SixLabors.ImageSharp.Formats.Experimental.Tiff.Writers
this.pixelsAsGray = this.MemoryAllocator.Allocate<byte>(height * this.Image.Width); this.pixelsAsGray = this.MemoryAllocator.Allocate<byte>(height * this.Image.Width);
} }
this.pixelsAsGray.Clear();
Span<byte> pixelAsGraySpan = this.pixelsAsGray.Slice(0, height * this.Image.Width); Span<byte> pixelAsGraySpan = this.pixelsAsGray.Slice(0, height * this.Image.Width);
Span<TPixel> pixels = GetStripPixels(this.imageBlackWhite.GetRootFramePixelBuffer(), y, height); Span<TPixel> pixels = GetStripPixels(this.imageBlackWhite.GetRootFramePixelBuffer(), y, height);

Loading…
Cancel
Save