Skip to content

Commit 04dc663

Browse files
authored
fixed some Variable copied when it could be moved Coverity warnings (danmar#7943)
1 parent 900148c commit 04dc663

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/analyzerinfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ std::string AnalyzerInformation::getAnalyzerInfoFile(const std::string &buildDir
142142
filename = sourcefile;
143143
else
144144
filename = sourcefile.substr(pos + 1);
145-
return Path::join(buildDir, filename) + ".analyzerinfo";
145+
return Path::join(buildDir, std::move(filename)) + ".analyzerinfo";
146146
}
147147

148148
bool AnalyzerInformation::analyzeFile(const std::string &buildDir, const std::string &sourcefile, const std::string &cfg, int fileIndex, std::size_t hash, std::list<ErrorMessage> &errors)

lib/checkother.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4442,7 +4442,7 @@ static std::vector<Union> parseUnions(const SymbolDatabase &symbolDatabase,
44424442
for (const Variable &var : scope.varlist) {
44434443
u.members.push_back(parseUnionMember(var, settings));
44444444
}
4445-
unions.push_back(u);
4445+
unions.push_back(std::move(u));
44464446
}
44474447

44484448
return unions;

lib/platform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ bool Platform::loadFromFile(const std::vector<std::string>& paths, const std::st
180180
std::vector<std::string> filenames;
181181
if (is_abs_path)
182182
{
183-
filenames.push_back(fullfilename);
183+
filenames.push_back(std::move(fullfilename));
184184
}
185185
else {
186186
// TODO: drop duplicated paths

0 commit comments

Comments
 (0)