diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2010-10-08 15:54:44 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2010-10-08 15:54:44 +0100 |
commit | 24c8e03cdf4e8cf1455d5d098515bd61eb2c89ba (patch) | |
tree | f0d7f6c9b9aa95c7e916106dc04591db89992844 | |
parent | 9f1bb370e9d46cf8b02bdf60f43700b4c1a80bed (diff) | |
download | rabbitmq-server-24c8e03cdf4e8cf1455d5d098515bd61eb2c89ba.tar.gz |
Gratuitous refactoring
-rw-r--r-- | src/rabbit_binding.erl | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl index a0389a52..61a3b7f5 100644 --- a/src/rabbit_binding.erl +++ b/src/rabbit_binding.erl @@ -331,14 +331,12 @@ remove_for_destination(DstName, FwdDeleteFun) -> end, Grouped) end. -post_binding_removal(IsDeleted, Src = #exchange{ type = Type }, Bs) -> - Module = type_to_module(Type), - case IsDeleted of - {auto_deleted, Fun} -> ok = Module:delete(Src, Bs), - Fun(), - ok; - not_deleted -> ok = Module:remove_bindings(Src, Bs) - end. +post_binding_removal(not_deleted, Src = #exchange{ type = Type }, Bs) -> + ok = type_to_module(Type):remove_bindings(Src, Bs); +post_binding_removal({auto_deleted, Fun}, Src = #exchange{ type = Type }, Bs) -> + ok = type_to_module(Type):delete(Src, Bs), + Fun(), + ok. %% Requires that its input binding list is sorted in exchange-name %% order, so that the grouping of bindings (for passing to |