summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-04-08 18:33:44 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2011-04-08 18:33:44 +0100
commitc8d1a130a5bb48c30e65399ad416b37a27e53afd (patch)
tree448f9c7e66ea52b8a2a0f9fa4858601b6bdfd593
parentab9625d32692ff221a449d3952a911e840ffa944 (diff)
downloadrabbitmq-server-bug24031.tar.gz
shrinkbug24031
-rw-r--r--src/rabbit_misc.erl24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 814a5bbc..87181c24 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) ->