Skip to content

Commit 45326b0

Browse files
committed
Prevent unnecessary assignments
1 parent 0983496 commit 45326b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Psalm/Internal/Analyzer/Statements/Block/IfAnalyzer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,10 @@ function (Clause $c) use ($changed_var_ids): bool {
665665
if ($internally_applied_if_cond_expr !== $cond
666666
|| $externally_applied_if_cond_expr !== $cond
667667
) {
668-
$assigned_var_ids = $outer_context->assigned_var_ids;
668+
$assigned_var_ids = $first_cond_assigned_var_ids;
669669
$if_conditional_context->assigned_var_ids = [];
670670

671-
$referenced_var_ids = $outer_context->referenced_var_ids;
671+
$referenced_var_ids = $first_cond_referenced_var_ids;
672672
$if_conditional_context->referenced_var_ids = [];
673673

674674
$if_conditional_context->inside_conditional = true;

0 commit comments

Comments
 (0)