Omit repeated computations

This commit is contained in:
Dmitry-Me 2017-09-11 18:36:44 +03:00
parent 56544ac936
commit 988de6422e
1 changed files with 4 additions and 3 deletions

View File

@ -526,9 +526,10 @@ void SymbolDatabase::createSymbolDatabaseFindAllScopes()
}
if (Token::Match(tok, "= %any% ;")) {
function.isPure(tok->strAt(1) == "0");
function.isDefault(tok->strAt(1) == "default");
function.isDelete(tok->strAt(1) == "delete");
const std::string& modifier = tok->strAt(1);
function.isPure(modifier == "0");
function.isDefault(modifier == "default");
function.isDelete(modifier == "delete");
tok = tok->tokAt(2);
}