summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2011-05-12 00:14:25 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-05-12 00:14:25 +0200
commit096e56d61c4841afad0c678730539a93c94110d9 (patch)
tree2dd6167ee8aac32c3599e9231650cc018729e16b
parent8711d9517fad67bb05203e4a303082acec1bfcc1 (diff)
Fix code readability in port_compiler
-rw-r--r--src/rebar_port_compiler.erl30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/rebar_port_compiler.erl b/src/rebar_port_compiler.erl
index 32a9015..9b19045 100644
--- a/src/rebar_port_compiler.erl
+++ b/src/rebar_port_compiler.erl
@@ -275,15 +275,15 @@ compiler(_) -> "$CC".
merge_each_var([], Vars) ->
Vars;
merge_each_var([{Key, Value} | Rest], Vars) ->
- case orddict:find(Key, Vars) of
- error ->
- %% Nothing yet defined for this key/value.
- %% Expand any self-references as blank.
- Evalue = expand_env_variable(Value, Key, "");
- {ok, Value0} ->
- %% Use previous definition in expansion
- Evalue = expand_env_variable(Value, Key, Value0)
- end,
+ Evalue = case orddict:find(Key, Vars) of
+ error ->
+ %% Nothing yet defined for this key/value.
+ %% Expand any self-references as blank.
+ expand_env_variable(Value, Key, "");
+ {ok, Value0} ->
+ %% Use previous definition in expansion
+ expand_env_variable(Value, Key, Value0)
+ end,
merge_each_var(Rest, orddict:store(Key, Evalue, Vars)).
%%
@@ -313,12 +313,12 @@ expand_vars_loop(Vars0, Count) ->
expand_vars(Key, Value, Vars) ->
lists:foldl(
fun({AKey, AValue}, Acc) ->
- case AKey of
- Key ->
- NewValue = AValue;
- _ ->
- NewValue = expand_env_variable(AValue, Key, Value)
- end,
+ NewValue = case AKey of
+ Key ->
+ AValue;
+ _ ->
+ expand_env_variable(AValue, Key, Value)
+ end,
[{AKey, NewValue} | Acc]
end,
[], Vars).