Skip to content

Commit a36cf81

Browse files
committed
Refactor
1 parent 986c28c commit a36cf81

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/tokenize.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,12 +1028,12 @@ bool Tokenizer::isFunctionPointer(const Token* tok) {
10281028
return Token::Match(tok, "%name% ) (");
10291029
}
10301030

1031-
static bool matchCurrentType(const std::string& typeStr, const std::map<int, std::string>& types, bool isC)
1031+
static bool matchCurrentType(const Token* tok, std::map<int, std::string>& types)
10321032
{
1033-
if (isC)
1033+
if (tok->isC())
10341034
return false;
10351035
return std::any_of(types.begin(), types.end(), [&](const std::pair<int, std::string>& element) {
1036-
return typeStr == element.second;
1036+
return tok->str() == element.second;
10371037
});
10381038
}
10391039

@@ -1088,7 +1088,7 @@ void Tokenizer::simplifyTypedef()
10881088
}
10891089

10901090
auto it = typedefs.find(tok->str());
1091-
if (it != typedefs.end() && it->second.canReplace(tok) && !matchCurrentType(tok->str(), inType, tok->isC())) {
1091+
if (it != typedefs.end() && it->second.canReplace(tok) && !matchCurrentType(tok, inType)) {
10921092
std::set<std::string> r;
10931093
std::string originalname;
10941094
while (it != typedefs.end() && r.insert(tok->str()).second) {

0 commit comments

Comments
 (0)