mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Fix code readability in port_compiler
This commit is contained in:
parent
8711d9517f
commit
096e56d61c
1 changed files with 15 additions and 15 deletions
|
@ -275,15 +275,15 @@ compiler(_) -> "$CC".
|
||||||
merge_each_var([], Vars) ->
|
merge_each_var([], Vars) ->
|
||||||
Vars;
|
Vars;
|
||||||
merge_each_var([{Key, Value} | Rest], Vars) ->
|
merge_each_var([{Key, Value} | Rest], Vars) ->
|
||||||
case orddict:find(Key, Vars) of
|
Evalue = case orddict:find(Key, Vars) of
|
||||||
error ->
|
error ->
|
||||||
%% Nothing yet defined for this key/value.
|
%% Nothing yet defined for this key/value.
|
||||||
%% Expand any self-references as blank.
|
%% Expand any self-references as blank.
|
||||||
Evalue = expand_env_variable(Value, Key, "");
|
expand_env_variable(Value, Key, "");
|
||||||
{ok, Value0} ->
|
{ok, Value0} ->
|
||||||
%% Use previous definition in expansion
|
%% Use previous definition in expansion
|
||||||
Evalue = expand_env_variable(Value, Key, Value0)
|
expand_env_variable(Value, Key, Value0)
|
||||||
end,
|
end,
|
||||||
merge_each_var(Rest, orddict:store(Key, Evalue, Vars)).
|
merge_each_var(Rest, orddict:store(Key, Evalue, Vars)).
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
@ -313,12 +313,12 @@ expand_vars_loop(Vars0, Count) ->
|
||||||
expand_vars(Key, Value, Vars) ->
|
expand_vars(Key, Value, Vars) ->
|
||||||
lists:foldl(
|
lists:foldl(
|
||||||
fun({AKey, AValue}, Acc) ->
|
fun({AKey, AValue}, Acc) ->
|
||||||
case AKey of
|
NewValue = case AKey of
|
||||||
Key ->
|
Key ->
|
||||||
NewValue = AValue;
|
AValue;
|
||||||
_ ->
|
_ ->
|
||||||
NewValue = expand_env_variable(AValue, Key, Value)
|
expand_env_variable(AValue, Key, Value)
|
||||||
end,
|
end,
|
||||||
[{AKey, NewValue} | Acc]
|
[{AKey, NewValue} | Acc]
|
||||||
end,
|
end,
|
||||||
[], Vars).
|
[], Vars).
|
||||||
|
|
Loading…
Reference in a new issue