-
Notifications
You must be signed in to change notification settings - Fork 292
Use record struct in FileHeaderOffset #1161
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #if !NET | ||
| namespace System.Runtime.CompilerServices | ||
| { | ||
| internal static class IsExternalInit { } | ||
| } | ||
| #endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, including the
IEquatableimplementation. See .NET LabThere was a problem hiding this comment.
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
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not implementing these means it's going to use the
EqualityComparer<int>.DefaultSee https://lab.razor.fyi/#pZHBSgMxEIZRLGhO4hPMsb3kAVxbkKptRVDo4sGTaXa6DWaTdiYrFOnDeBUPevXNvEl2D66lFcScMv_8f75JIt5aQtyQz0kVUvPRc6tk43IYLzlgkYhmJfveWtTBeMdygA7J6F8co6Iog5pYXPOcGZU7z8Fo3t6RfZ_hqVN2yWbddmXcYk1KZ4QqMy7fpstU8QMnQhgXkJyyEBve2SUQak8ZcKBSB7gwFoeoMqTr6ZQxtI0LcKtsiR3xJAAA5uXEGg3-EYlMhjEYiakfV5t2B7q9OiG_tUSs_s4eFfMGHo5hdL4oVfWmJxu8vf8NGKPN_MR7CxFoub2BBj7MkDpVoubGRRhKcvXp0O3WJlmVNWElNs4YrznAMFQ8iz_fnPGHnIjV5a7mu4P91_fPj5fp4d79zhc
In this specific case (single
intin thestruct), it's unsure if it's an actual improvement (might be an overkill).See here for different benchmarks on
record structhttps://nietras.com/2021/06/14/csharp-10-record-struct/