summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Fenoll <pierrefenoll@gmail.com>2018-02-17 01:20:29 +0100
committerPierre Fenoll <pierrefenoll@gmail.com>2018-03-02 12:53:22 +0100
commite504ba71e152a1e47719269f0108ad47c8f3f8b9 (patch)
treec6c863760081e33da02543f1340a0efd8e0fc089
parent9f0e3a2e5b6ea3eccda14660bc64570738ee7796 (diff)
sort-as: found the issue. Will look into tests now
-rw-r--r--src/rebar_state.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl
index 577ed23..7ebe6da 100644
--- a/src/rebar_state.erl
+++ b/src/rebar_state.erl
@@ -87,8 +87,8 @@ new(Config) when is_list(Config) ->
opts = Opts }.
-spec new(t() | atom(), list()) -> t().
-new(Profile, Config) when is_atom(Profile)
- , is_list(Config) ->
+new(Profile, Config) when is_atom(Profile),
+ is_list(Config) ->
BaseState = base_state(),
Opts = base_opts(Config),
BaseState#state_t { dir = rebar_dir:get_cwd(),
@@ -283,11 +283,12 @@ apply_profiles(State=#state_t{default = Defaults, current_profiles=CurrentProfil
end, Defaults, AppliedProfiles),
State#state_t{current_profiles = AppliedProfiles, opts=NewOpts}.
+%% @doc A stable deduplicator.
deduplicate(Profiles) ->
- do_deduplicate(lists:reverse(Profiles), []).
+ do_deduplicate(Profiles, []).
do_deduplicate([], Acc) ->
- Acc;
+ lists:reverse(Acc);
do_deduplicate([Head | Rest], Acc) ->
case lists:member(Head, Acc) of
true -> do_deduplicate(Rest, Acc);