-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
refactor: make status
a const function in rejection handling
#3168
Conversation
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.
could you add the const
keyword for the second macro variant too?
and do you know if we could do the same for __composite_rejection
?
No, because it uses
Yes I can, for the |
I'm talking about the function in line 115, and I don't see a |
- Updated the `status` method to be a const function for improved performance and compile-time evaluation. Signed-off-by: Awiteb <a@4rs.nl>
8d86a54
to
101d446
Compare
|
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.
Makes sense to me, but please note that this does not impact performance in any way. const fn
means it can be evaluated in const
contexts such as const ITEM
s and static
s, it has no influence on whether optimizations like constant folding are applied in code outside of a const
context.
Could you add changelog entries to |
Signed-off-by: Awiteb <a@4rs.nl>
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.
Thanks!
Fix #3167, Updated the
status
method to be a const function for improved performance and compile-time evaluation.Motivation
Allows the status code to be evaluated at compile time
Solution