Updated Rector to commit 2adeacc410de9304137574d2e80cf97c9f67dfa5

2adeacc410 [Performance]EarlyReturn] Reduce repetitive findFirst() on IfAndAnalyzer::isIfStmtExprUsedInNextReturn() (#5709)
This commit is contained in:
Tomas Votruba 2024-03-11 02:12:38 +00:00
parent 8201d0fc9b
commit 4026ff15b0
2 changed files with 9 additions and 10 deletions

View File

@ -42,14 +42,13 @@ final class IfAndAnalyzer
return \false;
}
$ifExprs = $this->betterNodeFinder->findInstanceOf($if->stmts, Expr::class);
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) {
return \true;
return (bool) $this->betterNodeFinder->findFirst($return->expr, function (Node $node) use($ifExprs) : bool {
foreach ($ifExprs as $ifExpr) {
if ($this->nodeComparator->areNodesEqual($node, $ifExpr)) {
return \true;
}
}
}
return \false;
return \false;
});
}
}

View File

@ -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
*/