Skip to content

Commit 86fc91f

Browse files
committed
autoresearch: avoid SpecifiedTypes allocation in setRootExpr when unchanged
1 parent d8f5be7 commit 86fc91f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Analyser/SpecifiedTypes.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public function setAlwaysOverwriteTypes(): self
6262
*/
6363
public function setRootExpr(?Expr $rootExpr): self
6464
{
65+
if ($this->rootExpr === $rootExpr) {
66+
return $this;
67+
}
68+
6569
$self = new self($this->sureTypes, $this->sureNotTypes);
6670
$self->overwrite = $this->overwrite;
6771
$self->newConditionalExpressionHolders = $this->newConditionalExpressionHolders;

0 commit comments

Comments
 (0)