Skip to content

Commit ea5f10a

Browse files
authored
MutatingScope->createConditionalExpressions(): cheap checks first (#5126)
1 parent f08de42 commit ea5f10a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Analyser/MutatingScope.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4105,16 +4105,18 @@ private function createConditionalExpressions(
41054105
if (!$holder->getCertainty()->yes()) {
41064106
continue;
41074107
}
4108-
if ($mergedExpressionTypes[$exprString]->equalTypes($holder)) {
4109-
continue;
4110-
}
4108+
41114109
if (
41124110
array_key_exists($exprString, $theirExpressionTypes)
41134111
&& !$theirExpressionTypes[$exprString]->getCertainty()->yes()
41144112
) {
41154113
continue;
41164114
}
41174115

4116+
if ($mergedExpressionTypes[$exprString]->equalTypes($holder)) {
4117+
continue;
4118+
}
4119+
41184120
$typeGuards[$exprString] = $holder;
41194121
}
41204122

0 commit comments

Comments
 (0)