Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Additional refactoring

  • Loading branch information...
commit 20ac7e0be2dce79b7b4a0cc6a903a3d716d04d95 1 parent 9c34ca6
@Gianfrancoalongi authored
Showing with 11 additions and 12 deletions.
  1. +11 −12 run1/src/mrz_plugin_loader.erl
View
23 run1/src/mrz_plugin_loader.erl
@@ -25,23 +25,22 @@ try_load_plugins(PluginList) ->
lists:foldr(
fun(PluginSrc,Acc) ->
Base = filename:basename(PluginSrc,".erl"),
- Module = list_to_atom(Base),
- case code:is_loaded(Module) of
- {file,_} ->
- [ Module | Acc];
- false ->
- maybe_load_file(Module,Acc)
- end
+ maybe_load_file(list_to_atom(Base),Acc)
end,
[],
PluginList).
maybe_load_file(Module,Acc) ->
- case code:load_file(Module) of
- {error,_} ->
- Acc;
- {module,_} ->
- [ Module | Acc]
+ case code:is_loaded(Module) of
+ {file,_} ->
+ [ Module | Acc];
+ false ->
+ case code:load_file(Module) of
+ {error,_} ->
+ Acc;
+ {module,_} ->
+ [ Module | Acc]
+ end
end.
Please sign in to comment.
Something went wrong with that request. Please try again.