Skip to content

Conversation

@iamcarbon
Copy link
Contributor

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

  • Use span helpers (Fill & Copy) in PdfJsHuffmanTable
  • General code cleanup.

@iamcarbon
Copy link
Contributor Author

Ready for review.

@codecov
Copy link

codecov bot commented Apr 19, 2018

Codecov Report

Merging #537 into master will decrease coverage by <.01%.
The diff coverage is 86.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #537      +/-   ##
==========================================
- Coverage   87.68%   87.67%   -0.01%     
==========================================
  Files         838      838              
  Lines       34698    34684      -14     
  Branches     2534     2533       -1     
==========================================
- Hits        30424    30410      -14     
  Misses       3524     3524              
  Partials      750      750
Impacted Files Coverage Δ
...ts/ImageSharp.Tests/Formats/Jpg/JFifMarkerTests.cs 100% <ø> (ø) ⬆️
...s/Jpg/ReferenceImplementationsTests.AccurateDCT.cs 100% <ø> (ø) ⬆️
...p.Tests/Formats/Jpg/JpegImagePostProcessorTests.cs 67.92% <ø> (ø) ⬆️
...sts/Formats/Jpg/Block8x8FTests.CopyToBufferArea.cs 0% <ø> (ø) ⬆️
...s/ReferenceImplementations.GT_FloatingPoint_DCT.cs 100% <ø> (ø) ⬆️
...ils/ReferenceImplementations.StandardIntegerDCT.cs 93.68% <ø> (ø) ⬆️
...ests/Formats/Jpg/Utils/ReferenceImplementations.cs 65.3% <ø> (ø) ⬆️
...ImageSharp.Tests/Formats/Jpg/Utils/LibJpegTools.cs 86.79% <ø> (ø) ⬆️
...s/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs 100% <ø> (ø) ⬆️
.../ImageSharp.Tests/Formats/Jpg/LibJpegToolsTests.cs 82.35% <ø> (ø) ⬆️
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b7538f...c968e29. Read the comment docs.

/// <param name="huffval">The huffman value array</param>
/// <param name="huffcodeRef">The huffman code span ref</param>
private void GenerateLookaheadTables(byte[] lengths, byte[] huffval, ref short huffcodeRef)
private void GenerateLookaheadTables(ReadOnlySpan<byte> lengths, ReadOnlySpan<byte> huffval, ref short huffcodeRef)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a micro-optimization but remember span is slower than array on older platforms so we should be careful not to reduce throughput.

@JimBobSquarePants JimBobSquarePants merged commit 07a811c into SixLabors:master Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants