Commit f3d15c67 authored by Sven Brauch's avatar Sven Brauch
Browse files

Fix a performance issue with multiple calls in a chain

see unit test from previous commit for an example.
BUG:316894
The cause for the issue was calling the parent visitor in the Expression
Visitor *plus* creating an extra expression visitor. Creating the
extra visitor is bad enough (n**2 compexity) but additionally calling
AstDefaultVisitor::visit... will blow it up to exp(n).
parent 23fb2b25
......@@ -193,8 +193,6 @@ QList< TypePtr< StructureType > > ExpressionVisitor::typeListForDeclarationList(
void ExpressionVisitor::visitAttribute(AttributeAst* node)
{
Python::AstDefaultVisitor::visitAttribute(node);
ExpressionAst* accessingAttributeOf = node->value;
ExpressionVisitor v(this);
......@@ -279,7 +277,7 @@ void ExpressionVisitor::visitCall(CallAst* node)
kDebug();
foreach ( ExpressionAst* c, node->arguments ) {
Python::AstDefaultVisitor::visitNode(c);
AstDefaultVisitor::visitNode(c);
}
AstDefaultVisitor::visitNode(node->keywordArguments);
AstDefaultVisitor::visitNode(node->starArguments);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment