Skip to content

Commit 486393a

Browse files
github-actions[bot]staabmclaude
authored andcommitted
Reorder equals() to do cheap string comparison before expensive type comparison
Co-authored-by: Markus Staab <markus.staab@redaxo.de> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6fac4a9 commit 486393a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Type/ClassConstantAccessType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public function getReferencedTemplateTypes(TemplateTypeVariance $positionVarianc
3535
public function equals(Type $type): bool
3636
{
3737
return $type instanceof self
38-
&& $this->type->equals($type->type)
39-
&& $this->constantName === $type->constantName;
38+
&& $this->constantName === $type->constantName
39+
&& $this->type->equals($type->type);
4040
}
4141

4242
public function describe(VerbosityLevel $level): string

0 commit comments

Comments
 (0)