aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-03-24 06:50:23 +0100
committerBjörn Gustavsson <[email protected]>2011-08-16 08:58:47 +0200
commit778eece5cdc55f19daf354ed374a556dde37cafa (patch)
tree51870e048853f244e2714cfc6e323b06cda7cd28 /lib/debugger/src
parent704d3240cd05ecc1218547a493fab80f99c8e2fd (diff)
downloadotp-778eece5cdc55f19daf354ed374a556dde37cafa.tar.gz
otp-778eece5cdc55f19daf354ed374a556dde37cafa.tar.bz2
otp-778eece5cdc55f19daf354ed374a556dde37cafa.zip
Slightly clean-up and optimize some evaluation code
There is no need to set #ieval.top to false in every iteration of eval_list/1.
Diffstat (limited to 'lib/debugger/src')
-rw-r--r--lib/debugger/src/dbg_ieval.erl17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl
index cfa8e60d63..e343e6f1e0 100644
--- a/lib/debugger/src/dbg_ieval.erl
+++ b/lib/debugger/src/dbg_ieval.erl
@@ -616,10 +616,9 @@ expr({value,Val}, Bs, _Ieval) -> % Special case straight values
%% List
expr({cons,Line,H0,T0}, Bs0, Ieval0) ->
- Ieval = Ieval0#ieval{line=Line},
- Ieval1 = Ieval#ieval{top=false},
- {value,H,Bs1} = expr(H0,Bs0,Ieval1),
- {value,T,Bs2} = expr(T0,Bs0,Ieval1),
+ Ieval = Ieval0#ieval{line=Line,top=false},
+ {value,H,Bs1} = expr(H0, Bs0, Ieval),
+ {value,T,Bs2} = expr(T0, Bs0, Ieval),
{value,[H|T],merge_bindings(Bs2, Bs1, Ieval)};
%% Tuple
@@ -1182,12 +1181,12 @@ flush_traces(Debugged) ->
%% eval_list(ExpressionList, Bindings, Ieval)
%% Evaluate a list of expressions "in parallel" at the same level.
eval_list(Es, Bs, Ieval) ->
- eval_list(Es, [], Bs, Bs, Ieval).
+ eval_list_1(Es, [], Bs, Bs, Ieval#ieval{top=false}).
-eval_list([E|Es], Vs, BsOrig, Bs0, Ieval) ->
- {value,V,Bs1} = expr(E, BsOrig, Ieval#ieval{top=false}),
- eval_list(Es, [V|Vs], BsOrig, merge_bindings(Bs1,Bs0,Ieval), Ieval);
-eval_list([], Vs, _, Bs, _Ieval) ->
+eval_list_1([E|Es], Vs, BsOrig, Bs0, Ieval) ->
+ {value,V,Bs1} = expr(E, BsOrig, Ieval),
+ eval_list_1(Es, [V|Vs], BsOrig, merge_bindings(Bs1, Bs0, Ieval), Ieval);
+eval_list_1([], Vs, _, Bs, _Ieval) ->
{lists:reverse(Vs,[]),Bs}.
%% if_clauses(Clauses, Bindings, Ieval)