@@ -505,7 +505,7 @@ void CheckCondition::duplicateCondition()
505505 ErrorPath errorPath;
506506 if (!findExpressionChanged (cond1, scope.classDef ->next (), cond2, mSettings , mTokenizer ->isCPP ()) &&
507507 isSameExpression (mTokenizer ->isCPP (), true , cond1, cond2, mSettings ->library , true , true , &errorPath))
508- duplicateConditionError (cond1, cond2, errorPath);
508+ duplicateConditionError (cond1, cond2, std::move ( errorPath) );
509509 }
510510}
511511
@@ -1193,7 +1193,7 @@ void CheckCondition::checkIncorrectLogicOperator()
11931193 }
11941194
11951195 const std::string cond1 = expr1 + " " + tok->str () + " (" + expr2 + " " + tok->astOperand2 ()->str () + " " + expr3 + " )" ;
1196- const std::string cond2 = expr1;
1196+ const std::string cond2 = std::move ( expr1) ;
11971197
11981198 const std::string cond1VerboseMsg = expr1VerboseMsg + " " + tok->str () + " " + expr2VerboseMsg + " " + tok->astOperand2 ()->str () + " " + expr3VerboseMsg;
11991199 const std::string& cond2VerboseMsg = expr1VerboseMsg;
@@ -1316,9 +1316,9 @@ void CheckCondition::checkIncorrectLogicOperator()
13161316 const std::string cond2str = conditionString (not2, expr2, op2, value2);
13171317 if (printWarning && (alwaysTrue || alwaysFalse)) {
13181318 const std::string text = cond1str + " " + tok->str () + " " + cond2str;
1319- incorrectLogicOperatorError (tok, text, alwaysTrue, inconclusive, errorPath);
1319+ incorrectLogicOperatorError (tok, text, alwaysTrue, inconclusive, std::move ( errorPath) );
13201320 } else if (printStyle && (firstTrue || secondTrue)) {
1321- const int which = isfloat ? sufficientCondition (op1, not1, d1, op2, not2, d2, isAnd) : sufficientCondition (op1, not1, i1, op2, not2, i2, isAnd);
1321+ const int which = isfloat ? sufficientCondition (std::move ( op1) , not1, d1, std::move ( op2) , not2, d2, isAnd) : sufficientCondition (std::move ( op1) , not1, i1, std::move ( op2) , not2, i2, isAnd);
13221322 std::string text;
13231323 if (which != 0 ) {
13241324 text = " The condition '" + (which == 1 ? cond2str : cond1str) + " ' is redundant since '" + (which == 1 ? cond1str : cond2str) + " ' is sufficient." ;
0 commit comments