Refactoring: use MathLib add/sub instead of calculate
This commit is contained in:
parent
3ad8f98c61
commit
84e576de04
|
@ -5878,9 +5878,9 @@ bool Tokenizer::simplifyCalculations()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Token::Match(tok->previous(), "- %num% - %num%"))
|
if (Token::Match(tok->previous(), "- %num% - %num%"))
|
||||||
tok->str(MathLib::calculate(tok->str(), tok->tokAt(2)->str(), '+'));
|
tok->str(MathLib::add(tok->str(), tok->tokAt(2)->str()));
|
||||||
else if (Token::Match(tok->previous(), "- %num% + %num%"))
|
else if (Token::Match(tok->previous(), "- %num% + %num%"))
|
||||||
tok->str(MathLib::calculate(tok->str(), tok->tokAt(2)->str(), '-'));
|
tok->str(MathLib::sub(tok->str(), tok->tokAt(2)->str()));
|
||||||
else
|
else
|
||||||
tok->str(MathLib::calculate(tok->str(), tok->tokAt(2)->str(), tok->strAt(1)[0]));
|
tok->str(MathLib::calculate(tok->str(), tok->tokAt(2)->str(), tok->strAt(1)[0]));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue