Get rid of tokAt() and strAt() in trivial cases.

This commit is contained in:
Dmitry-Me 2014-07-14 11:44:58 +04:00
parent 954400a382
commit 2989f70898
2 changed files with 5 additions and 2 deletions

View File

@ -40,7 +40,7 @@ void CheckAssert::assertWithSideEffects()
const Token *endTok = tok ? tok->next()->link() : nullptr;
while (tok && endTok) {
for (const Token* tmp = tok->tokAt(1); tmp != endTok; tmp = tmp->next()) {
for (const Token* tmp = tok->next(); tmp != endTok; tmp = tmp->next()) {
checkVariableAssignment(tmp, true);
if (tmp->isName() && tmp->type() == Token::eFunction) {

View File

@ -104,7 +104,10 @@ public:
}
const std::string& name() const {
return classDef->next()->isName() ? classDef->strAt(1) : emptyString;
const Token* next = classDef->next();
if (next->isName())
return next->str();
return emptyString;
}
const Token *initBaseInfo(const Token *tok, const Token *tok1);