Refactoring: use MathLib add/sub instead of calculate

This commit is contained in:
Daniel Marjamäki 2010-07-24 10:13:45 +02:00
parent 3ad8f98c61
commit 84e576de04
1 changed files with 2 additions and 2 deletions

View File

@ -5878,9 +5878,9 @@ bool Tokenizer::simplifyCalculations()
}
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%"))
tok->str(MathLib::calculate(tok->str(), tok->tokAt(2)->str(), '-'));
tok->str(MathLib::sub(tok->str(), tok->tokAt(2)->str()));
else
tok->str(MathLib::calculate(tok->str(), tok->tokAt(2)->str(), tok->strAt(1)[0]));