Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Improve performance: remove unnecessary loop on SimpleCallableNodeTraverser #3053

Conversation

samsonasik
Copy link
Member

Loop over nodes with verify parent Node was introduced on PR:

to handle private method used in FuncCall with ArrowFunction.

This PR try to improve performance by remove the loop, with simplified solution by verify:

  • passed node variable is a Node

    • then check if its parent Node is Node
      • when no parent, no need to connect.
  • otherwise, it is an array of Nodes, which mostly usage is by pass $node->stmts, which parent node is the $node so no need to loop over to verify.

@TomasVotruba TomasVotruba merged commit 21b1ff9 into main Nov 11, 2022
@TomasVotruba TomasVotruba deleted the improve-performance-remove-unnecessary-loop-on-simple-callable-node-traverser branch November 11, 2022 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants