diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2011-04-08 18:33:44 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-04-08 18:33:44 +0100 |
| commit | 147307d9846e21fdce76b686d51710113accd135 (patch) | |
| tree | 448f9c7e66ea52b8a2a0f9fa4858601b6bdfd593 /src | |
| parent | e48006cf4298ec2be31125246cf8f6d669f7da44 (diff) | |
| download | rabbitmq-server-git-147307d9846e21fdce76b686d51710113accd135.tar.gz | |
shrink
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_misc.erl | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 814a5bbcf2..87181c2453 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -467,20 +467,16 @@ map_in_order(F, L) -> %% We ignore entries that have been modified or removed. table_filter(Pred, PrePostCommitFun, TableName) -> lists:foldl( - fun (E, Acc) -> case execute_mnesia_transaction( - fun () -> case mnesia:match_object(TableName, E, - read) of - [] -> false; - _ -> Pred(E) - end - end, - fun (false, _Tx) -> false; - (true, Tx) -> PrePostCommitFun(E, Tx), - true - end) of - false -> Acc; - true -> [E | Acc] - end + fun (E, Acc) -> + case execute_mnesia_transaction( + fun () -> mnesia:match_object(TableName, E, read) =/= [] + andalso Pred(E) end, + fun (false, _Tx) -> false; + (true, Tx) -> PrePostCommitFun(E, Tx), true + end) of + false -> Acc; + true -> [E | Acc] + end end, [], dirty_read_all(TableName)). dirty_read_all(TableName) -> |
