Skip to content

Commit

Permalink
Prevent unnecessary assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Oct 19, 2020
1 parent 0983496 commit 45326b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Psalm/Internal/Analyzer/Statements/Block/IfAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,10 @@ function (Clause $c) use ($changed_var_ids): bool {
if ($internally_applied_if_cond_expr !== $cond
|| $externally_applied_if_cond_expr !== $cond
) {
$assigned_var_ids = $outer_context->assigned_var_ids;
$assigned_var_ids = $first_cond_assigned_var_ids;
$if_conditional_context->assigned_var_ids = [];

$referenced_var_ids = $outer_context->referenced_var_ids;
$referenced_var_ids = $first_cond_referenced_var_ids;
$if_conditional_context->referenced_var_ids = [];

$if_conditional_context->inside_conditional = true;
Expand Down

0 comments on commit 45326b0

Please sign in to comment.