diff options
author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-11 13:35:26 +0100 |
---|---|---|
committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-11 13:35:26 +0100 |
commit | 23a11e1fe5d4aa7590ffea791705670a84b61bdc (patch) | |
tree | 26008f3630cde610450a83bd1a96069921fd6ea2 /src | |
parent | 8d441fbd3c212e68bb236b8be2b51c9e4e807e03 (diff) | |
download | rabbitmq-server-23a11e1fe5d4aa7590ffea791705670a84b61bdc.tar.gz |
Changed uses of gb_sets:difference/2 to our difference functions.
Diffstat (limited to 'src')
-rw-r--r-- | src/dtree.erl | 5 | ||||
-rw-r--r-- | src/rabbit_msg_store.erl | 3 | ||||
-rw-r--r-- | src/rabbit_variable_queue.erl | 11 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/dtree.erl b/src/dtree.erl index 67bbbc1b..8eff0644 100644 --- a/src/dtree.erl +++ b/src/dtree.erl @@ -91,7 +91,8 @@ take(PKs, SK, {P, S}) -> none -> {[], {P, S}}; {value, PKS} -> TakenPKS = gb_sets:from_list(PKs), PKSInter = gb_sets:intersection(PKS, TakenPKS), - PKSDiff = gb_sets:difference (PKS, TakenPKS), + PKSDiff = + rabbit_misc:gb_sets_difference(PKS, TakenPKS), {KVs, P1} = take2(PKSInter, SK, P), {KVs, {P1, case gb_sets:is_empty(PKSDiff) of true -> gb_trees:delete(SK, S); @@ -152,7 +153,7 @@ take_all2(PKS, P) -> prune(SKS, PKS, S) -> gb_sets:fold(fun (SK0, S0) -> PKS1 = gb_trees:get(SK0, S0), - PKS2 = gb_sets:difference(PKS1, PKS), + PKS2 = rabbit_misc:gb_sets_difference(PKS1, PKS), case gb_sets:is_empty(PKS2) of true -> gb_trees:delete(SK0, S0); false -> gb_trees:update(SK0, PKS2, S0) diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index 56265136..8ffd5b13 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -1240,7 +1240,8 @@ client_confirm(CRef, MsgIds, ActionTaken, State) -> case dict:find(CRef, CTM) of {ok, Gs} -> MsgOnDiskFun(gb_sets:intersection(Gs, MsgIds), ActionTaken), - MsgIds1 = gb_sets:difference(Gs, MsgIds), + MsgIds1 = + rabbit_misc:gb_sets_difference(Gs, MsgIds), case gb_sets:is_empty(MsgIds1) of true -> dict:erase(CRef, CTM); false -> dict:store(CRef, MsgIds1, CTM) diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 46f6d6c1..6e8a1cca 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -1291,10 +1291,13 @@ record_confirms(MsgIdSet, State = #vqstate { msgs_on_disk = MOD, msg_indices_on_disk = MIOD, unconfirmed = UC, confirmed = C }) -> - State #vqstate { msgs_on_disk = gb_sets:difference(MOD, MsgIdSet), - msg_indices_on_disk = gb_sets:difference(MIOD, MsgIdSet), - unconfirmed = gb_sets:difference(UC, MsgIdSet), - confirmed = gb_sets:union (C, MsgIdSet) }. + State #vqstate { msgs_on_disk = + rabbit_misc:gb_sets_difference(MOD, MsgIdSet), + msg_indices_on_disk = + rabbit_misc:gb_sets_difference(MIOD, MsgIdSet), + unconfirmed = + rabbit_misc:gb_sets_difference(UC, MsgIdSet), + confirmed = gb_sets:union(C, MsgIdSet) }. must_sync_index(#vqstate { msg_indices_on_disk = MIOD, unconfirmed = UC }) -> |