Skip to content

Commit

Permalink
sort-as: found the issue. Will look into tests now
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp committed Feb 23, 2018
1 parent 790f6e8 commit 0f7e6c3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/rebar_state.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0f7e6c3

Please sign in to comment.