summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-02-14 23:07:11 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2012-02-14 23:07:11 +0000
commita7a37e1e930867d86b23568c3d4ff7ea3464a0b0 (patch)
tree0a1403ba2fe96e0512acc5350bc8372753e84e00
parent6e9306854b4c6a25adcacc6946c5219c68b1ca41 (diff)
downloadrabbitmq-server-a7a37e1e930867d86b23568c3d4ff7ea3464a0b0.tar.gz
refactor: less strange variable scoping
-rw-r--r--src/rabbit_misc.erl15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 9a6879b1..b6d38172 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -720,13 +720,14 @@ gb_trees_foreach(Fun, Tree) ->
%% [{"-q",true},{"-p","/"}]}
get_options(Defs, As) ->
lists:foldl(fun(Def, {AsIn, RsIn}) ->
- {AsOut, Value} = case Def of
- {flag, Key} ->
- get_flag(Key, AsIn);
- {option, Key, Default} ->
- get_option(Key, Default, AsIn)
- end,
- {AsOut, [{Key, Value} | RsIn]}
+ {K, {AsOut, V}} =
+ case Def of
+ {flag, Key} ->
+ {Key, get_flag(Key, AsIn)};
+ {option, Key, Default} ->
+ {Key, get_option(Key, Default, AsIn)}
+ end,
+ {AsOut, [{K, V} | RsIn]}
end, {As, []}, Defs).
get_option(K, _Default, [K, V | As]) ->