Skip to content

Commit

Permalink
Use lists:flatmap/2
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuncer Ayaz committed Feb 7, 2012
1 parent 28c44cb commit 1c1a32b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/rebar_port_compiler.erl
Expand Up @@ -179,14 +179,14 @@ get_sources(Config) ->
end.

expand_port_specs(Specs) ->
lists:append(lists:map(fun({_, Target, FileSpecs}) ->
expand_file_specs(Target, FileSpecs);
({Target, FileSpecs}) ->
expand_file_specs(Target, FileSpecs)
end, filter_port_specs(Specs))).
lists:flatmap(fun({_, Target, FileSpecs}) ->
expand_file_specs(Target, FileSpecs);
({Target, FileSpecs}) ->
expand_file_specs(Target, FileSpecs)
end, filter_port_specs(Specs)).

expand_file_specs(Target, FileSpecs) ->
Sources = lists:append([filelib:wildcard(FS) || FS <- FileSpecs]),
Sources = lists:flatmap(fun filelib:wildcard/1, FileSpecs),
[{Target, Src} || Src <- Sources].

filter_port_specs(Specs) ->
Expand Down

0 comments on commit 1c1a32b

Please sign in to comment.