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
cleanup: use std::make_shared to replace new #12276
Conversation
Looks good at a quick glance. @wwformat, did you use some kind of script to pick these out? Be helpful if you can share it. :) |
@@ -562,7 +562,7 @@ int main(int argc, const char **argv) | |||
::encode(v, final); | |||
::encode(mapbl, final); | |||
|
|||
MonitorDBStore::TransactionRef t(new MonitorDBStore::Transaction); | |||
MonitorDBStore::TransactionRef t(std::make_shared<MonitorDBStore::Transaction>()); |
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.
nit, why not use auto
instead?
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 feel the 'auto' keyword is suitable for complex template declare
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.
OK, I have updated and use auto keyword.
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
Signed-off-by: Yunchuan Wen <yunchuan.wen@kylin-cloud.com>
retest this please. |
I repeat the test, and the step is: The result is: |
@wwformat sorry for the confusion, "retest this please" was a command for jenkins to re-trigger the build/test job. i wanted to see if the failure is transient or not. |
Still wondering how you found/picked out these ones. In the MDS "grep 'new Mutation'" matches the count of changed ones here, but there are several other shared_ptr typedefs which haven't been hit. Are these just the ones you know about and were bugging you? Was there some single script, or set of scripts we'll get another PR on? :) |
There are many declare of shared_ptr like XXXRef or XXX::Ref. |
Signed-off-by: Yunchuan Wen yunchuan.wen@kylin-cloud.com