Optimize createSymbolDatabaseExprIds() (#5017)
This commit is contained in:
parent
4fdcb0c784
commit
96cf2b34fd
|
@ -1626,10 +1626,11 @@ void SymbolDatabase::createSymbolDatabaseExprIds()
|
||||||
// Apply CSE
|
// Apply CSE
|
||||||
for (const auto& p:exprs) {
|
for (const auto& p:exprs) {
|
||||||
const std::vector<Token*>& tokens = p.second;
|
const std::vector<Token*>& tokens = p.second;
|
||||||
for (Token* tok1:tokens) {
|
const std::size_t N = tokens.size();
|
||||||
for (Token* tok2:tokens) {
|
for (std::size_t i = 0; i < N; ++i) {
|
||||||
if (tok1 == tok2)
|
Token* const tok1 = tokens[i];
|
||||||
continue;
|
for (std::size_t j = i + 1; j < N; ++j) {
|
||||||
|
Token* const tok2 = tokens[j];
|
||||||
if (tok1->exprId() == tok2->exprId())
|
if (tok1->exprId() == tok2->exprId())
|
||||||
continue;
|
continue;
|
||||||
if (!isSameExpression(isCPP(), true, tok1, tok2, mSettings.library, false, false))
|
if (!isSameExpression(isCPP(), true, tok1, tok2, mSettings.library, false, false))
|
||||||
|
|
Loading…
Reference in New Issue