Skip to content

Commit 367c5b5

Browse files
DanielEScherzerkocsismate
authored andcommitted
gen_stub: stop cloning FramelessFunctionInfo objects
They are immutable
1 parent d8e8ce0 commit 367c5b5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

build/gen_stub.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -2085,9 +2085,6 @@ public function __clone()
20852085
$this->args[$key] = clone $argInfo;
20862086
}
20872087
$this->return = clone $this->return;
2088-
foreach ($this->framelessFunctionInfos as $key => $framelessFunctionInfo) {
2089-
$this->framelessFunctionInfos[$key] = clone $framelessFunctionInfo;
2090-
}
20912088
}
20922089
}
20932090

@@ -4227,6 +4224,8 @@ function parseDocComment(DocComment $comment): array {
42274224
return $tags;
42284225
}
42294226

4227+
// Instances of FramelessFunctionInfo are immutable and do not need to be cloned
4228+
// when held by an object that is cloned
42304229
class FramelessFunctionInfo {
42314230
public /* readonly */ int $arity;
42324231

0 commit comments

Comments
 (0)