diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2011-04-08 18:55:18 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-04-08 18:55:18 +0100 |
commit | 499a08ca8c8288caf3cb73bcf04e00de463f655d (patch) | |
tree | 448f9c7e66ea52b8a2a0f9fa4858601b6bdfd593 | |
parent | 16d52ee78e6924f4631edae6b9b0221efcd1d918 (diff) | |
parent | c8d1a130a5bb48c30e65399ad416b37a27e53afd (diff) | |
download | rabbitmq-server-499a08ca8c8288caf3cb73bcf04e00de463f655d.tar.gz |
merge bug24031 into default
-rw-r--r-- | src/rabbit_misc.erl | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 85e08615..87181c24 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -467,17 +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) -> execute_mnesia_transaction( - fun () -> case mnesia:match_object(TableName, E, - read) of - [] -> false; - _ -> Pred(E) - end - end, - fun (false, _Tx) -> Acc; - (true, Tx) -> PrePostCommitFun(E, Tx), - [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) -> |