mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit 2adeacc410de9304137574d2e80cf97c9f67dfa5
2adeacc410
[Performance]EarlyReturn] Reduce repetitive findFirst() on IfAndAnalyzer::isIfStmtExprUsedInNextReturn() (#5709)
This commit is contained in:
parent
8201d0fc9b
commit
4026ff15b0
|
@ -42,14 +42,13 @@ final class IfAndAnalyzer
|
|||
return \false;
|
||||
}
|
||||
$ifExprs = $this->betterNodeFinder->findInstanceOf($if->stmts, Expr::class);
|
||||
return (bool) $this->betterNodeFinder->findFirst($return->expr, function (Node $node) use($ifExprs) : bool {
|
||||
foreach ($ifExprs as $ifExpr) {
|
||||
$isExprFoundInReturn = (bool) $this->betterNodeFinder->findFirst($return->expr, function (Node $node) use($ifExpr) : bool {
|
||||
return $this->nodeComparator->areNodesEqual($node, $ifExpr);
|
||||
});
|
||||
if ($isExprFoundInReturn) {
|
||||
if ($this->nodeComparator->areNodesEqual($node, $ifExpr)) {
|
||||
return \true;
|
||||
}
|
||||
}
|
||||
return \false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '57894303baab2e24a24387b48c5e94963e78ad26';
|
||||
public const PACKAGE_VERSION = '2adeacc410de9304137574d2e80cf97c9f67dfa5';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-03-11 00:09:51';
|
||||
public const RELEASE_DATE = '2024-03-11 09:10:24';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue