From f61ca47b23af0f5e19fda440e1c0b34591e3d502 Mon Sep 17 00:00:00 2001 From: David Kubecka Date: Mon, 23 Mar 2015 21:19:44 +0100 Subject: [PATCH] Remove useless compile/3 Its case statement is noop. --- src/rebar_base_compiler.erl | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/rebar_base_compiler.erl b/src/rebar_base_compiler.erl index c38fb11..f49fc85 100644 --- a/src/rebar_base_compiler.erl +++ b/src/rebar_base_compiler.erl @@ -129,21 +129,10 @@ remove_common_path1([Part | RestFilename], [Part | RestPath]) -> remove_common_path1(FilenameParts, _) -> filename:join(FilenameParts). - -compile(Unit, Config, CompileFn) -> - case CompileFn(Unit, Config) of - ok -> - ok; - skipped -> - skipped; - Error -> - Error - end. - compile_each([], _Config, _CompileFn) -> ok; compile_each([Unit | Rest], Config, CompileFn) -> - case compile(Unit, Config, CompileFn) of + case CompileFn(Unit, Config) of ok -> ?CONSOLE("Compiled ~s\n", [unit_source(Unit)]); {ok, Warnings} -> @@ -224,7 +213,7 @@ compile_worker(QueuePid, Config, CompileFn) -> QueuePid ! {next, self()}, receive {compile, Source} -> - case catch(compile(Source, Config, CompileFn)) of + case catch(CompileFn(Source, Config)) of {ok, Ws} -> QueuePid ! {compiled, Source, Ws}, compile_worker(QueuePid, Config, CompileFn);