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 Code Quality 2 #799

Merged
merged 6 commits into from
Mar 16, 2024
Merged

Improve Code Quality 2 #799

merged 6 commits into from
Mar 16, 2024

Conversation

iamcarbon
Copy link
Collaborator

This PR:

  • Spanifies internal Adler32Checksum and Crc32 methods
  • Use switch expressions
  • Enables nullable annotations (this just allows us to begin annotating, before turning on fully)
  • Use collection expressions in more places where semantics don't change
  • Prefer is null to == null (this ensures that we compare directly against null, and don't call an overloaded == operator)

@iamcarbon
Copy link
Collaborator Author

@EliotJones @BobLd Ready for feedback / review.

@BobLd BobLd self-requested a review March 16, 2024 07:42
@BobLd
Copy link
Collaborator

BobLd commented Mar 16, 2024

@iamcarbon 2 comments, only one needs an update

@@ -22,8 +22,8 @@ public static byte[] Decode(byte[] inputBytes, int predictor, int colors, int bi
int bitsPerPixel = colors * bitsPerComponent;
int bytesPerPixel = (bitsPerPixel + 7) / 8;
int rowlength = (columns * bitsPerPixel + 7) / 8;
byte[] actline = new byte[rowlength];
byte[] lastline = new byte[rowlength];
var actline = new byte[rowlength];
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's avoid these var changes, they don't add much value and add noise to the PR (leave them as is for the PR though)

@@ -1,10 +1,10 @@
namespace UglyToad.PdfPig.Parser.Parts
{
using Core;
Copy link
Collaborator

Choose a reason for hiding this comment

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

please keep System first

@BobLd BobLd merged commit 95f0459 into UglyToad:master Mar 16, 2024
1 check passed
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