Skip to content

Commit

Permalink
Replace v->var->lb with simple_meet
Browse files Browse the repository at this point in the history
and remove the unneeded Null check.

Co-Authored-By: Jameson Nash <[email protected]>
  • Loading branch information
N5N3 and vtjnash committed Sep 14, 2022
1 parent 562f7bf commit f1a660b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/subtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -3248,20 +3248,14 @@ static int merge_env(jl_stenv_t *e, jl_value_t **root, jl_savedenv_t *se, int co
}
int n = 0;
jl_varbinding_t *v = e->vars;
jl_value_t *ub = NULL, *vub = NULL;
JL_GC_PUSH2(&ub, &vub);
while (v != NULL) {
jl_value_t *lb = jl_svecref(*root, n);
if (v->lb != lb)
jl_svecset(*root, n, lb ? v->var->lb : v->lb);
ub = jl_svecref(*root, n+1);
vub = v->ub;
if (vub != ub)
jl_svecset(*root, n+1, ub ? simple_join(ub, vub) : vub);
// update the low bound
jl_svecset(*root, n, simple_meet(jl_svecref(*root, n), v->lb));
// update the up bound
jl_svecset(*root, n+1, simple_join(jl_svecref(*root, n+1), v->ub));
n = n + 3;
v = v->prev;
}
JL_GC_POP();
return count + 1;
}

Expand Down

0 comments on commit f1a660b

Please sign in to comment.