diff options
author | Björn Gustavsson <[email protected]> | 2015-03-06 09:49:06 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-03-09 09:41:19 +0100 |
commit | b99eeee59ae95548e935bcbc512f6488baa0c6ba (patch) | |
tree | 29cc90294d74ee732e2aa9f9a736d968f495df0f /lib | |
parent | c5e808c27beeef8cfc5eaa4ab37aeaaaef3db849 (diff) | |
download | otp-b99eeee59ae95548e935bcbc512f6488baa0c6ba.tar.gz otp-b99eeee59ae95548e935bcbc512f6488baa0c6ba.tar.bz2 otp-b99eeee59ae95548e935bcbc512f6488baa0c6ba.zip |
v3_core: Eliminate the sloppiness-encouraging get_ianno/1 function
get_ianno/1 would retrieve either a bare annotation or an
annotation wrapped in an #a{} record. In both cases, it would
return a wrapped annotation.
We can replace the calls to get_ianno/1 with calls to get_anno/1,
because the argument is always an #iclause{} and all iclause records
are always initialized with a wrapped annotation.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compiler/src/v3_core.erl | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl index cd44fb459b..3c19a209c0 100644 --- a/lib/compiler/src/v3_core.erl +++ b/lib/compiler/src/v3_core.erl @@ -1798,7 +1798,7 @@ uclauses(Lcs, Ks, St0) -> uclause(Cl0, Ks, St0) -> {Cl1,_Pvs,Used,New,St1} = uclause(Cl0, Ks, Ks, St0), - A0 = get_ianno(Cl1), + A0 = get_anno(Cl1), A = A0#a{us=Used,ns=New}, {Cl1#iclause{anno=A},St1}. @@ -1985,7 +1985,7 @@ ufun_clauses(Lcs, Ks, St0) -> ufun_clause(Cl0, Ks, St0) -> {Cl1,Pvs,Used,_,St1} = uclause(Cl0, [], Ks, St0), - A0 = get_ianno(Cl1), + A0 = get_anno(Cl1), A = A0#a{us=subtract(intersection(Used, Ks), Pvs),ns=[]}, {Cl1#iclause{anno=A},St1}. @@ -2333,12 +2333,6 @@ lineno_anno(L, St) -> [Line] ++ St#core.file end. -get_ianno(Ce) -> - case get_anno(Ce) of - #a{}=A -> A; - A when is_list(A) -> #a{anno=A} - end. - get_lineno_anno(Ce) -> case get_anno(Ce) of #a{anno=A} -> A; |