-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add clang tidy performance checks #8429
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
base: main
Are you sure you want to change the base?
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.
Looks very well. I left just 2 minor suggestions you may want to refer to. Good job overall!
RegistryEntry{ | ||
std::move(animationsVector), | ||
buildAnimationToIndexMap(animationsVector)}); | ||
animationsVector, buildAnimationToIndexMap(animationsVector)}); |
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.
I think that we should keep std::move
here and just remove the const
modifier from the animationsVector
declaration:
const auto animationsVector =
buildAnimationsVector(rt, shadowNode, animationNames, newAnimations);
This std::move
call was added purposely but the the const
modifier near the animationsVector
prevented it from working as expected.
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.
What I don't get here is why do we move the animationsVector first and then try to use it straight away. Isn't it in indeterminate state after that?
DelayedItem<TValue>::DelayedItem(const double timestamp, const TValue value) | ||
: timestamp(timestamp), value(value) {} | ||
: timestamp(timestamp), value(std::move(value)) {} |
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.
DelayedItem<TValue>::DelayedItem(const double timestamp, const TValue value) | |
: timestamp(timestamp), value(value) {} | |
: timestamp(timestamp), value(std::move(value)) {} | |
DelayedItem<TValue>::DelayedItem(const double timestamp, TValue value) | |
: timestamp(timestamp), value(std::move(value)) {} |
Good change. I think you also should remove const
from the value
parameter declaration.
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.
Done. I changed timestamp to not-const
as well because that's how it's declared in .h
.
…comply with the .h
Summary
I uncommented
- performance-*
clang-tidy check glob. This check encourages good performance practices. After that I solved CSA errors generated by the code.