diff options
author | Ben Hood <0x6e6562@gmail.com> | 2008-10-11 11:49:41 +0100 |
---|---|---|
committer | Ben Hood <0x6e6562@gmail.com> | 2008-10-11 11:49:41 +0100 |
commit | 73500b1dd739f613dca09d2df3815e6ef6ea8be2 (patch) | |
tree | 9ec68eeaa7a41826211608b5ba40747143744603 | |
parent | e7d9f270496246d3fffc0a19c76e0c52b489c0c2 (diff) | |
download | rabbitmq-server-73500b1dd739f613dca09d2df3815e6ef6ea8be2.tar.gz |
Don't hassle the HOF
-rw-r--r-- | src/rabbit_exchange.erl | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 4528bdac..e6641685 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -273,16 +273,14 @@ has_bindings(ExchangeName) -> MatchHead = #route{binding = #binding{exchange_name = ExchangeName, queue_name = '$1', key = '_'}}, - continue(fun() -> - mnesia:select(route, [{MatchHead, [], ['$1']}], 1, read) - end). - -continue(Fun) -> - case Fun() of - '$end_of_table' -> false; - {[], Cont} -> continue(fun() -> mnesia:select(Cont) end); - _ -> true - end. + continue(mnesia:select(route, [{MatchHead, [], ['$1']}], 1, read)). + +continue('$end_of_table') -> + false; +continue({[], Continuation}) -> + continue(mnesia:select(Continuation)); +continue(_) -> + true. call_with_exchange(Exchange, Fun) -> case mnesia:wread({exchange, Exchange}) of |