diff options
author | Alan Conway <aconway@apache.org> | 2009-05-01 19:59:57 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2009-05-01 19:59:57 +0000 |
commit | 91e3b712f13fcbf3834ae547bd05254738dfed8e (patch) | |
tree | 36265cf107759f8fe309f02a3a3dba84dfb4bef2 /cpp/src/qpid/broker/SemanticState.cpp | |
parent | f3cec6986a366d133a08647279a38393a9769718 (diff) | |
download | qpid-python-91e3b712f13fcbf3834ae547bd05254738dfed8e.tar.gz |
Replace std::list with std::deque for SemanticState::unacked - more efficient, improves latency.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@770802 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SemanticState.cpp')
-rw-r--r-- | cpp/src/qpid/broker/SemanticState.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp index 3c7c6d9afa..b2df5e36a3 100644 --- a/cpp/src/qpid/broker/SemanticState.cpp +++ b/cpp/src/qpid/broker/SemanticState.cpp @@ -440,7 +440,7 @@ void SemanticState::recover(bool requeue) //unconfirmed messages re redelivered and therefore have their //id adjusted, confirmed messages are not and so the ordering //w.r.t id is lost - unacked.sort(); + std::sort(unacked.begin(), unacked.end()); } } @@ -642,12 +642,12 @@ void SemanticState::accepted(DeliveryId first, DeliveryId last) //if the messages are already completed, they can be //removed from the record - unacked.remove_if(mem_fun_ref(&DeliveryRecord::isRedundant)); + unacked.erase(std::remove_if(unacked.begin(), unacked.end(), mem_fun_ref(&DeliveryRecord::isRedundant)), unacked.end()); } } else { for_each(range.start, range.end, boost::bind(&DeliveryRecord::accept, _1, (TransactionContext*) 0)); - unacked.remove_if(mem_fun_ref(&DeliveryRecord::isRedundant)); + unacked.erase(std::remove_if(unacked.begin(), unacked.end(), mem_fun_ref(&DeliveryRecord::isRedundant)), unacked.end()); } } @@ -655,7 +655,7 @@ void SemanticState::completed(DeliveryId first, DeliveryId last) { AckRange range = findRange(first, last); for_each(range.start, range.end, boost::bind(&SemanticState::complete, this, _1)); - unacked.remove_if(mem_fun_ref(&DeliveryRecord::isRedundant)); + unacked.erase(std::remove_if(unacked.begin(), unacked.end(), mem_fun_ref(&DeliveryRecord::isRedundant)), unacked.end()); requestDispatch(); } |