summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Ashton <robashton@codeofrob.com>2019-07-24 10:24:34 +0000
committerRob Ashton <robashton@codeofrob.com>2019-07-24 10:24:34 +0000
commit6d8c544ecd0440ab959220f1cb121bb4ffa8678f (patch)
treee039df4da7419dcdc0bc0aee968859e61ad2081e
parent18b39d7382ca1cd8ba5cb108142590f8ce824c33 (diff)
Stick the usort in our termination clause
-rw-r--r--src/rebar_compiler_erl.erl29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/rebar_compiler_erl.erl b/src/rebar_compiler_erl.erl
index da4a1b0..95f3a17 100644
--- a/src/rebar_compiler_erl.erl
+++ b/src/rebar_compiler_erl.erl
@@ -245,21 +245,20 @@ module_to_erl(Mod) ->
atom_to_list(Mod) ++ ".erl".
parse_attrs(Fd, Includes, Dir) ->
- DupIncludes = case io:parse_erl_form(Fd, "") of
- {ok, Form, _Line} ->
- case erl_syntax:type(Form) of
- attribute ->
- NewIncludes = process_attr(Form, Includes, Dir),
- parse_attrs(Fd, NewIncludes, Dir);
- _ ->
- parse_attrs(Fd, Includes, Dir)
- end;
- {eof, _} ->
- Includes;
- _Err ->
- parse_attrs(Fd, Includes, Dir)
- end,
- lists:usort(DupIncludes).
+ case io:parse_erl_form(Fd, "") of
+ {ok, Form, _Line} ->
+ case erl_syntax:type(Form) of
+ attribute ->
+ NewIncludes = process_attr(Form, Includes, Dir),
+ parse_attrs(Fd, NewIncludes, Dir);
+ _ ->
+ parse_attrs(Fd, Includes, Dir)
+ end;
+ {eof, _} ->
+ lists:usort(Includes);
+ _Err ->
+ parse_attrs(Fd, Includes, Dir)
+ end.
process_attr(Form, Includes, Dir) ->
AttrName = erl_syntax:atom_value(erl_syntax:attribute_name(Form)),