summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPierre Fenoll <pierrefenoll@gmail.com>2018-02-23 12:50:38 +0100
committerPierre Fenoll <pierrefenoll@gmail.com>2018-03-02 12:53:22 +0100
commit1d2aa24ef0d0bc6d1177cce361d7718f887eb03e (patch)
treef8291899675e18f10cca2059ed2dbc622cd9e16f /src
parent6aeff6300bf8986079ac6e8f83fa37150e239810 (diff)
Revert "sort-as: found the issue. Will look into tests now"
This reverts commit 0f7e6c31e97c238649e7ae0a1b7087e342174ecc.
Diffstat (limited to 'src')
-rw-r--r--src/rebar_state.erl9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rebar_state.erl b/src/rebar_state.erl
index 7ebe6da..577ed23 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,12 +283,11 @@ 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(Profiles, []).
+ do_deduplicate(lists:reverse(Profiles), []).
do_deduplicate([], Acc) ->
- lists:reverse(Acc);
+ Acc;
do_deduplicate([Head | Rest], Acc) ->
case lists:member(Head, Acc) of
true -> do_deduplicate(Rest, Acc);