Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CQ7 #678

Merged
merged 7 commits into from
Aug 21, 2018
Merged

Improve CQ7 #678

merged 7 commits into from
Aug 21, 2018

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

  • Improves a few error messages
  • Replaces == null with is null (== is overloadable, and can be used on Spans)
  • Throws NRE directly in trival contexts (avoiding the call overhead + expanded callstack on exception)
  • Annotates a few additional fields as readonly

@CLAassistant
Copy link

CLAassistant commented Aug 17, 2018

CLA assistant check
All committers have signed the CLA.

@iamcarbon iamcarbon changed the title Improve CQ Improve CQ7 Aug 17, 2018
@codecov
Copy link

codecov bot commented Aug 17, 2018

Codecov Report

Merging #678 into master will decrease coverage by 0.01%.
The diff coverage is 53.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #678      +/-   ##
==========================================
- Coverage   85.18%   85.17%   -0.02%     
==========================================
  Files         878      878              
  Lines       39122    39090      -32     
  Branches     2539     2539              
==========================================
- Hits        33328    33293      -35     
- Misses       5101     5104       +3     
  Partials      693      693
Impacted Files Coverage Δ
...rc/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs 84.82% <ø> (ø) ⬆️
src/ImageSharp/Formats/Bmp/BmpDecoder.cs 100% <ø> (ø) ⬆️
.../Processing/Transforms/ProjectiveTransformTests.cs 97.22% <0%> (ø) ⬆️
...C/TagDataEntries/IccTextDescriptionTagDataEntry.cs 51.61% <0%> (ø) ⬆️
...rc/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs 84% <0%> (ø) ⬆️
...rofiles/ICC/DataWriter/IccDataWriter.Primitives.cs 89.79% <0%> (ø) ⬆️
...files/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs 66.66% <0%> (ø) ⬆️
...mageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs 53.33% <0%> (ø) ⬆️
...aData/Profiles/Exif/ExifTagDescriptionAttribute.cs 53.84% <0%> (ø) ⬆️
...rofiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs 56% <0%> (ø) ⬆️
... and 68 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 f11263f...9f7915b. Read the comment docs.

@iamcarbon
Copy link
Contributor Author

Ready for review.

@@ -550,7 +550,8 @@ private void WriteApplicationHeader(ImageMetaData meta)
private void WriteDefineHuffmanTables(int componentCount)
{
// Table identifiers.
byte[] headers = { 0x00, 0x10, 0x01, 0x11 };
Span<byte> headers = stackalloc byte[] { 0x00, 0x10, 0x01, 0x11 };
Copy link
Member

Choose a reason for hiding this comment

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

We should keep an eye out for more things like this but I suspect you already have it covered 👍

@JimBobSquarePants JimBobSquarePants merged commit e5a43f0 into SixLabors:master Aug 21, 2018
antonfirsov pushed a commit to antonfirsov/ImageSharp that referenced this pull request Nov 11, 2019
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.

3 participants