summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Kuch <jerryk@vmware.com>2010-12-08 15:39:18 -0800
committerJerry Kuch <jerryk@vmware.com>2010-12-08 15:39:18 -0800
commit7612daef19ac6393b5b8db3cc7980ec43d92b340 (patch)
treef61475e3b8725f02428fbd3dae5aaa7286b115d7
parent9cacdaf40138b910c7cd2e1047db9f9d9b4d5154 (diff)
downloadrabbitmq-server-7612daef19ac6393b5b8db3cc7980ec43d92b340.tar.gz
List comprehension in Mnesia upgrade functions to cut code duplication.
-rw-r--r--src/rabbit_upgrade_functions.erl14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/rabbit_upgrade_functions.erl b/src/rabbit_upgrade_functions.erl
index bf8e3a1f..af3996c2 100644
--- a/src/rabbit_upgrade_functions.erl
+++ b/src/rabbit_upgrade_functions.erl
@@ -74,18 +74,16 @@ add_ip_to_listener() ->
[node, protocol, host, ip_address, port]).
add_internal_to_exchange_and_durable_exchange() ->
+ Tables = [rabbit_exchange, rabbit_durable_exchange],
AddInternalFun =
fun ({exchange, Name, Type, Durable, AutoDelete, Args}) ->
{exchange, Name, Type, Durable, AutoDelete, false, Args}
end,
- ok = mnesia(
- rabbit_exchange,
- AddInternalFun,
- [name, type, durable, auto_delete, internal, arguments]),
- mnesia(
- rabbit_durable_exchange,
- AddInternalFun,
- [name, type, durable, auto_delete, internal, arguments]).
+ [ ok = mnesia(T,
+ AddInternalFun,
+ [name, type, durable, auto_delete, internal, arguments])
+ || T <- Tables ],
+ ok.
%%--------------------------------------------------------------------