diff options
-rw-r--r-- | src/rabbit_exchange_decorator.erl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rabbit_exchange_decorator.erl b/src/rabbit_exchange_decorator.erl index 79ea212f..3abaa48c 100644 --- a/src/rabbit_exchange_decorator.erl +++ b/src/rabbit_exchange_decorator.erl @@ -93,13 +93,12 @@ filter(Modules) -> [M || M <- Modules, code:which(M) =/= non_existing]. set(X) -> - X#exchange{ - decorators = - lists:foldl(fun (D, {Route, NoRoute}) -> - Callbacks = D:active_for(X), - {cons_if_eq(all, Callbacks, D, Route), - cons_if_eq(noroute, Callbacks, D, NoRoute)} - end, {[], []}, list())}. + Decs = lists:foldl(fun (D, {Route, NoRoute}) -> + ActiveFor = D:active_for(X), + {cons_if_eq(all, ActiveFor, D, Route), + cons_if_eq(noroute, ActiveFor, D, NoRoute)} + end, {[], []}, list()), + X#exchange{decorators = Decs}. list() -> [M || {_, M} <- rabbit_registry:lookup_all(exchange_decorator)]. |