Skip to content

Use record struct in FileHeaderOffset - #1161

Merged
BobLd merged 1 commit into
UglyToad:masterfrom
BobLd:file-header-offset-rs
Sep 20, 2025
Merged

BobLd merged 1 commit into
UglyToad:masterfrom
BobLd:file-header-offset-rs

Conversation

@BobLd

@BobLd BobLd commented Sep 14, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

obj is FileHeaderOffset other && value == other.Value;

public override int GetHashCode() => value.GetHashCode();
public override int GetHashCode() => Value.GetHashCode();

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.

Don't record structs provide these default implementations already?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes, including the IEquatable implementation. See .NET Lab

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

They do, but with default implementation. It's seems to be more efficient for speed to provide it when possible. Ill provide the source of that shortly

@BobLd BobLd Sep 16, 2025 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@BobLd
BobLd merged commit a53d96c into UglyToad:master Sep 20, 2025
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