summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-06-25 14:47:32 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2011-06-25 14:47:32 +0100
commitab045589340e66916cc7be820dc36aa2970f1ec2 (patch)
treeff732be00415c42d959e9b71adcf1555cfd37bca /src
parent52d694ca254671430d325204b1a6ac052377445b (diff)
downloadrabbitmq-server-ab045589340e66916cc7be820dc36aa2970f1ec2.tar.gz
minor refactoring and simplification
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_variable_queue.erl13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index e1c78307..fd7bf2cc 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -577,14 +577,11 @@ dropwhile1(Pred, State) ->
in_r(MsgStatus = #msg_status { msg = undefined, index_on_disk = IndexOnDisk },
State = #vqstate { q3 = Q3, q4 = Q4, ram_index_count = RamIndexCount }) ->
case queue:is_empty(Q4) of
- true ->
- State #vqstate {
- q3 = bpqueue:in_r(IndexOnDisk, MsgStatus, Q3),
- ram_index_count = RamIndexCount + one_if(not IndexOnDisk) };
- false ->
- {MsgStatus1, State1 = #vqstate { q4 = Q4a }} =
- read_msg(MsgStatus, State),
- State1 #vqstate { q4 = queue:in_r(MsgStatus1, Q4a) }
+ true -> State #vqstate {
+ q3 = bpqueue:in_r(IndexOnDisk, MsgStatus, Q3),
+ ram_index_count = RamIndexCount + one_if(not IndexOnDisk) };
+ false -> {MsgStatus1, State1} = read_msg(MsgStatus, State),
+ State1 #vqstate { q4 = queue:in_r(MsgStatus1, Q4) }
end;
in_r(MsgStatus, State = #vqstate { q4 = Q4 }) ->
State #vqstate { q4 = queue:in_r(MsgStatus, Q4) }.