diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-02-05 14:48:52 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-02-05 14:48:52 +0000 |
commit | 946178bfa19a1b87d8ee946aefd32ad29341acc1 (patch) | |
tree | d9356592188a58b456341d10f29c9f8f6540c008 | |
parent | 1fbd4b7d3971f08148c70b00054da60437f1e920 (diff) | |
download | rabbitmq-server-bug25979.tar.gz |
Assuage dialyser. And possibly myself?bug25979
-rw-r--r-- | src/rabbit_runtime_parameters.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit_runtime_parameters.erl b/src/rabbit_runtime_parameters.erl index 35b3aace..18b9fbb8 100644 --- a/src/rabbit_runtime_parameters.erl +++ b/src/rabbit_runtime_parameters.erl @@ -179,16 +179,19 @@ lookup(VHost, Component, Name) -> Params -> p(Params) end. -value(VHost, Comp, Name) -> value_global({VHost, Comp, Name}). -value(VHost, Comp, Name, Def) -> value_global({VHost, Comp, Name}, Def). +value(VHost, Comp, Name) -> value0({VHost, Comp, Name}). +value(VHost, Comp, Name, Def) -> value0({VHost, Comp, Name}, Def). -value_global(Key) -> +value_global(Key) -> value0(Key). +value_global(Key, Default) -> value0(Key, Default). + +value0(Key) -> case lookup0(Key, rabbit_misc:const(not_found)) of not_found -> not_found; Params -> Params#runtime_parameters.value end. -value_global(Key, Default) -> +value0(Key, Default) -> Params = lookup0(Key, fun () -> lookup_missing(Key, Default) end), Params#runtime_parameters.value. |