8000 [Performance] Use more performance spl_object_id() by samsonasik · Pull Request #4876 · rectorphp/rector-src · GitHub
[go: up one dir, main page]

Skip to content

[Performance] Use more performance spl_object_id() #4876

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

Merged
merged 12 commits into from
Aug 28, 2023
Prev Previous commit
really final touch: rename variable
  • Loading branch information
samsonasik committed Aug 28, 2023
commit 4a29efc7830465025fa45b6ea30017c33503b8c0
4 changes: 2 additions & 2 deletions src/Rector/AbstractRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@ private function postRefactorProcess(
$this->refreshScopeNodes($refactoredNode, $filePath, $currentScope);

// search "infinite recursion" in https://github.com/nikic/PHP-Parser/blob/master/doc/component/Walking_the_AST.markdown
$originalNodeHash = spl_object_id($originalNode);
$originalNodeId = spl_object_id($originalNode);

// will be replaced in leaveNode() the original node must be passed
$this->nodesToReturn[$originalNodeHash] = $refactoredNode;
$this->nodesToReturn[$originalNodeId] = $refactoredNode;

return $originalNode;
}
Expand Down
0