Skip to content

Commit

Permalink
Prevent unnecessary calls to spl_object_id() (#4992)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Sep 11, 2023
1 parent b261756 commit 8b8a0d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/PhpDocParser/NodeVisitor/CallableNodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public function enterNode(Node $node): int|Node|null

public function leaveNode(Node $node): int|Node
{
if ($this->nodeIdToRemove === spl_object_id($node)) {
if ($this->nodeIdToRemove !== null
&& $this->nodeIdToRemove === spl_object_id($node)
) {
$this->nodeIdToRemove = null;
return NodeTraverser::REMOVE_NODE;
}
Expand Down

0 comments on commit 8b8a0d1

Please sign in to comment.