-
Notifications
You must be signed in to change notification settings - Fork 397
💥Require unit enum types to also be struct #1472
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is really bugging me with it's 0% coverage - I'm definitely going to do something about it soon.. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we want to be really strict about it, we should consider making the |
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.
This is great, introducing the
struct
constraint here opens up the possibility for usingUnsafe.As<TUnit, int>(ref unit)
instead of
Convert.ToInt32(unit)
which is ~34x faster on
net8.0
and ~92x faster onnet48
🚀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.
Sounds good!