diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2010-06-18 19:43:01 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2010-06-18 19:43:01 +0100 |
| commit | b39d55b09b96e3f45732d7d1dfa2853d6846582b (patch) | |
| tree | 9482fa1a226ad7c35c2ebff202e28ad1dedeed36 | |
| parent | f05592fc3f4821f57f505de0582b8b27625f639a (diff) | |
| download | rabbitmq-server-git-b39d55b09b96e3f45732d7d1dfa2853d6846582b.tar.gz | |
a little bit of inlining
| -rw-r--r-- | src/rabbit_variable_queue.erl | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index cfea41f0b9..c0c7c69e9a 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -772,15 +772,6 @@ update_rate(Now, Then, Count, {OThen, OCount}) -> persistent_guids(Pubs) -> [Guid || #basic_message { guid = Guid, is_persistent = true } <- Pubs]. -beta_bounds(Q) -> - case bpqueue:out(Q) of - {empty, Q} -> empty; - {{value, _IndexOnDisk1, #msg_status { seq_id = SeqIdMin }}, _Qa} -> - {{value, _IndexOnDisk2, #msg_status { seq_id = SeqIdMax }}, _Qb} = - bpqueue:out_r(Q), - {SeqIdMin, SeqIdMax} - end. - betas_from_index_entries(List, TransientThreshold, IndexState) -> {Filtered, Delivers, Acks} = lists:foldr( @@ -1375,20 +1366,22 @@ push_betas_to_deltas(State = #vqstate { q2 = Q2, ram_index_count = RamIndexCount3 }. push_betas_to_deltas(LimitFun, Generator, Q, RamIndexCount, IndexState) -> - case beta_bounds(Q) of - empty -> + case bpqueue:out(Q) of + {empty, Q} -> {?BLANK_DELTA, Q, RamIndexCount, IndexState}; - {MinSeqId, MaxSeqId} -> + {{value, _IndexOnDisk1, #msg_status { seq_id = MinSeqId }}, _Qa} -> + {{value, _IndexOnDisk2, #msg_status { seq_id = MaxSeqId }}, _Qb} = + bpqueue:out_r(Q), Limit = LimitFun(MinSeqId), case MaxSeqId < Limit of true -> {?BLANK_DELTA, Q, RamIndexCount, IndexState}; - false -> {Len, Qb, RamIndexCount1, IndexState1} = + false -> {Len, Qc, RamIndexCount1, IndexState1} = push_betas_to_deltas(Generator, Limit, Q, 0, RamIndexCount, IndexState), {#delta { start_seq_id = Limit, count = Len, end_seq_id = MaxSeqId + 1 }, - Qb, RamIndexCount1, IndexState1} + Qc, RamIndexCount1, IndexState1} end end. |
