diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2012-02-14 23:07:11 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-02-14 23:07:11 +0000 |
| commit | 14a593deae6ed574896f42cc15ac670a94565f63 (patch) | |
| tree | 0a1403ba2fe96e0512acc5350bc8372753e84e00 /src | |
| parent | 2e3746df0e5533bd5de1b805cfaa191bc7a33941 (diff) | |
| download | rabbitmq-server-git-14a593deae6ed574896f42cc15ac670a94565f63.tar.gz | |
refactor: less strange variable scoping
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_misc.erl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 9a6879b13d..b6d38172b5 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]) -> |
