Skip to content

#2231 First steps for removing nullable disable in webp - #2364

Merged
JimBobSquarePants merged 5 commits into
SixLabors:mainfrom
stefannikolei:stefannikolei/nullable/webp
Feb 24, 2023
Merged

JimBobSquarePants merged 5 commits into
SixLabors:mainfrom
stefannikolei:stefannikolei/nullable/webp

Conversation

@stefannikolei

Copy link
Copy Markdown
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 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

#2231 Remove nullable disable from some classes in the webp format

if (this.pos < this.bufferMax)
{
ulong inBits = BinaryPrimitives.ReadUInt64LittleEndian(this.Data.Memory.Span.Slice((int)this.pos, 8));
ulong inBits = BinaryPrimitives.ReadUInt64LittleEndian(this.Data!.Memory.Span.Slice((int)this.pos, 8));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's some horrible temporal coupling here. I don't think the correct fix would be to add !. It may require much deeper refactoring.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah probably. And there are some more classes where it is not so easy to remove the #nullable disable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm gonna be looking at some optimization opportunities in those classes. I think we should leave this until that is done.

We've covered all the public bits now anyway I think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok I tried to ref it. Can you have a look?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

image

Those are the areas where nullable disable is still set

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ok I tried to ref it. Can you have a look?

Ah nice, will do!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Refactor looks good. I just pushed some additional cleanup.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actions seems to be having a wobble. I'll merge in the morning.

@JimBobSquarePants
JimBobSquarePants merged commit a2429cc into SixLabors:main Feb 24, 2023
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