minor #4530 Use spl_object_id() instead of spl_object_hash() (rosier)

This PR was merged into the 3.x branch.

Discussion
----------

Use spl_object_id() instead of spl_object_hash()

Small performance tweak.

Commits
-------

51bf2ca737 Use spl_object_id() instead of spl_object_hash()
This commit is contained in:
Fabien Potencier
2025-01-03 08:09:15 +01:00
+2 -2
View File
@@ -42,7 +42,7 @@ final class SafeAnalysisNodeVisitor implements NodeVisitorInterface
*/
public function getSafe(Node $node)
{
$hash = spl_object_hash($node);
$hash = spl_object_id($node);
if (!isset($this->data[$hash])) {
return [];
}
@@ -64,7 +64,7 @@ final class SafeAnalysisNodeVisitor implements NodeVisitorInterface
private function setSafe(Node $node, array $safe): void
{
$hash = spl_object_hash($node);
$hash = spl_object_id($node);
if (isset($this->data[$hash])) {
foreach ($this->data[$hash] as &$bucket) {
if ($bucket['key'] === $node) {