diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_router.erl | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/rabbit_router.erl b/src/rabbit_router.erl index 1f3017fa07..396a20c6b2 100644 --- a/src/rabbit_router.erl +++ b/src/rabbit_router.erl @@ -36,17 +36,12 @@ %%---------------------------------------------------------------------------- -%% TODO: Maybe this should be handled by a cursor instead. -%% TODO: This causes a full scan for each entry with the same source match_bindings(SrcName, Match) -> - Query = qlc:q([DestinationName || - #route{binding = Binding = #binding{ - source = SrcName1, - destination = DestinationName}} <- - mnesia:table(rabbit_route), - SrcName == SrcName1, - Match(Binding)]), - mnesia:async_dirty(fun qlc:e/1, [Query]). + MatchHead = #route{binding = #binding{source = SrcName, + _ = '_'}}, + Routes = ets:select(rabbit_route, [{MatchHead, [], [['$_']]}]), + [Dest || [#route{binding = Binding = #binding{destination = Dest}}] <- + Routes, Match(Binding)]. match_routing_key(SrcName, [RoutingKey]) -> find_routes(#route{binding = #binding{source = SrcName, |
