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 40f8395
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/subtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -3248,16 +3248,15 @@ 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);
jl_value_t *b1 = NULL, *b2 = NULL;
JL_GC_PUSH2(&b1, &b2);
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);
b1 = jl_svecref(*root, n);
b2 = v->lb;
jl_svecset(*root, n, simple_meet(b1, b2));
b1 = jl_svecref(*root, n+1);
b2 = v->ub;
jl_svecset(*root, n+1, simple_join(b1, b2));
n = n + 3;
v = v->prev;
}
Expand Down

0 comments on commit 40f8395

Please sign in to comment.