aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-12-30 11:10:26 +0100
committerBjörn Gustavsson <[email protected]>2012-01-11 08:39:56 +0100
commite196820fad6b38b3969fc67d0b01853c7ac0d565 (patch)
tree6f40710a9ee666f859028ae19a28d6883f102f36 /lib/compiler/src
parent68651be298a997a22224f53445688a74dc2fab7d (diff)
downloadotp-e196820fad6b38b3969fc67d0b01853c7ac0d565.tar.gz
otp-e196820fad6b38b3969fc67d0b01853c7ac0d565.tar.bz2
otp-e196820fad6b38b3969fc67d0b01853c7ac0d565.zip
sys_core_fold: Refactor previous_ctx_to_binary/2 to cover it completely
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/sys_core_fold.erl12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index c92ee86e07..6a8fd8980c 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -2589,14 +2589,14 @@ bsm_maybe_ctx_to_binary(V, B) ->
body=B}
end.
-previous_ctx_to_binary(V, #c_seq{arg=#c_primop{name=Name,args=As}}) ->
- case {Name,As} of
- {#c_literal{val=bs_context_to_binary},[#c_var{name=V}]} ->
+previous_ctx_to_binary(V, Core) ->
+ case Core of
+ #c_seq{arg=#c_primop{name=#c_literal{val=bs_context_to_binary},
+ args=[#c_var{name=V}]}} ->
true;
- {_,_} ->
+ _ ->
false
- end;
-previous_ctx_to_binary(_, _) -> false.
+ end.
%% bsm_leftmost(Cs) -> none | ArgumentNumber
%% Find the leftmost argument that does binary matching. Return