-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fixed many COPY_INSTEAD_OF_MOVE
Coverity warnings
#5944
Conversation
cli/cppcheckexecutor.cpp
Outdated
@@ -194,7 +194,7 @@ int CppCheckExecutor::check(int argc, const char* const argv[]) | |||
mStdLogger = new StdLogger(settings); | |||
|
|||
CppCheck cppCheck(*mStdLogger, true, executeCommand); | |||
cppCheck.settings() = settings; | |||
cppCheck.settings() = std::move(settings); |
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 a bogus warning. The object is referenced in StdLogger
.
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.
The Settings
object should also be const
after construction to make sure it is no longer modified afterwards. That is still WIP.
Also the copy will go away after #4964 is done.
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 a variant of https://trac.cppcheck.net/ticket/12364.
949bfe2
to
d307417
Compare
The |
3732603
to
c636b73
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.
seems like we could easily find lots of more performance issues..
I gave it a short spin in the profiler and it doesn't have much of an impact. Guess the most important were already found earlier by review and profiling. |
No description provided.