Skip to content

Commit 1f9fa89

Browse files
committed
Merge pull request danmar#681 from Dmitry-Me/betterVariableName5
Better variable name, explicit no-op
2 parents fd81ee9 + 773ee8c commit 1f9fa89

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/checkmemoryleak.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
11981198
else {
11991199
bool use = false;
12001200

1201-
std::stack<const Token *> f;
1201+
std::stack<const Token *> functions;
12021202

12031203
for (const Token *tok2 = tok->next(); tok2; tok2 = tok2->next()) {
12041204
if (tok2->str() == ";") {
@@ -1207,17 +1207,18 @@ Token *CheckMemoryLeakInFunction::getcode(const Token *tok, std::list<const Toke
12071207
}
12081208

12091209
if (tok2->str() == "(")
1210-
f.push(tok2->previous());
1211-
else if (!f.empty() && tok2->str() == ")")
1212-
f.pop();
1210+
functions.push(tok2->previous());
1211+
else if (!functions.empty() && tok2->str() == ")")
1212+
functions.pop();
12131213

12141214
if (tok2->varId() == varid) {
12151215
// Read data..
12161216
if (!Token::Match(tok2->previous(), "&|(") &&
12171217
tok2->strAt(1) == "[") {
1218-
} else if (f.empty() ||
1219-
!test_white_list(f.top()->str(), _settings, tokenizer->isCPP()) ||
1220-
getDeallocationType(f.top(),varid)) {
1218+
;
1219+
} else if (functions.empty() ||
1220+
!test_white_list(functions.top()->str(), _settings, tokenizer->isCPP()) ||
1221+
getDeallocationType(functions.top(),varid)) {
12211222
use = true;
12221223
}
12231224
}

0 commit comments

Comments
 (0)