@@ -2222,7 +2222,7 @@ static bool isConstStatement(const Token *tok, const Library& library, bool plat
22222222 const bool isChained = succeeds (tok->astParent (), tok);
22232223 if (Token::simpleMatch (tok->astParent (), " [" )) {
22242224 if (isChained)
2225- return isConstStatement (tok->astOperand2 (), library, platformIndependent) &&
2225+ return isConstStatement (tok->astOperand2 (), library, platformIndependent) &&
22262226 isConstStatement (tok->astParent (), library, platformIndependent);
22272227 return isNestedBracket && isConstStatement (tok->astOperand2 (), library, platformIndependent);
22282228 }
@@ -2993,10 +2993,10 @@ void CheckOther::checkDuplicateExpression()
29932993 } else if (tok->astOperand1 () && tok->astOperand2 () && tok->str () == " :" && tok->astParent () && tok->astParent ()->str () == " ?" ) {
29942994 if (isSameExpression (true , tok->astOperand1 (), tok->astOperand2 (), *mSettings , false , true , &errorPath))
29952995 duplicateExpressionTernaryError (tok, std::move (errorPath));
2996-
2996+
29972997 else if (!tok->astOperand1 ()->values ().empty () && !tok->astOperand2 ()->values ().empty () && isEqualKnownValue (tok->astOperand1 (), tok->astOperand2 ()) &&
2998- !isVariableChanged (tok->astParent (), /* indirect*/ 0 , *mSettings ) &&
2999- isConstStatement (tok->astOperand1 (), mSettings ->library , true ) && isConstStatement (tok->astOperand2 (), mSettings ->library , true ))
2998+ !isVariableChanged (tok->astParent (), /* indirect*/ 0 , *mSettings ) &&
2999+ isConstStatement (tok->astOperand1 (), mSettings ->library , true ) && isConstStatement (tok->astOperand2 (), mSettings ->library , true ))
30003000 duplicateValueTernaryError (tok);
30013001 }
30023002 }
0 commit comments