aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/sys_core_fold.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-11-12 09:28:28 +0100
committerBjörn Gustavsson <[email protected]>2016-11-13 08:10:12 +0100
commitcb4b1276acae0406344a24d4597c0d33a1d72ac7 (patch)
tree26e7586b28d39dddc18822a917a0407a07af2821 /lib/compiler/src/sys_core_fold.erl
parent29a7ce7dd5d75658d3044b42b7ab6d57b706f663 (diff)
downloadotp-cb4b1276acae0406344a24d4597c0d33a1d72ac7.tar.gz
otp-cb4b1276acae0406344a24d4597c0d33a1d72ac7.tar.bz2
otp-cb4b1276acae0406344a24d4597c0d33a1d72ac7.zip
sys_core_fold: Remove unnecessary calls to opt_bool_case/1
The fixpoint iteration added in 05130e48 makes those calls superfluous.
Diffstat (limited to 'lib/compiler/src/sys_core_fold.erl')
-rw-r--r--lib/compiler/src/sys_core_fold.erl10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index 5d7fd37270..d20159c140 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -1606,16 +1606,14 @@ opt_bool_clauses(Cs, true, true) ->
[]
end;
opt_bool_clauses([#c_clause{pats=[#c_literal{val=Lit}],
- guard=#c_literal{val=true},
- body=B}=C0|Cs], SeenT, SeenF) ->
+ guard=#c_literal{val=true}}=C|Cs], SeenT, SeenF) ->
case is_boolean(Lit) of
false ->
%% Not a boolean - this clause can't match.
- add_warning(C0, nomatch_clause_type),
+ add_warning(C, nomatch_clause_type),
opt_bool_clauses(Cs, SeenT, SeenF);
true ->
%% This clause will match.
- C = C0#c_clause{body=opt_bool_case(B)},
case {Lit,SeenT,SeenF} of
{false,_,false} ->
[C|opt_bool_clauses(Cs, SeenT, true)];
@@ -2386,9 +2384,7 @@ is_safe_bool_expr_list([], _, _) -> true.
%% as a let or a sequence, move the original let body into the complex
%% expression.
-simplify_let(#c_let{arg=Arg0}=Let0, Sub) ->
- Arg = opt_bool_case(Arg0),
- Let = Let0#c_let{arg=Arg},
+simplify_let(#c_let{arg=Arg}=Let, Sub) ->
move_let_into_expr(Let, Arg, Sub).
move_let_into_expr(#c_let{vars=InnerVs0,body=InnerBody0}=Inner,