diff options
author | Alan Conway <aconway@apache.org> | 2009-05-25 18:20:50 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2009-05-25 18:20:50 +0000 |
commit | 92be0a347cdfd9c407611982c72938ecde777a8c (patch) | |
tree | 0b75b63ba491584667af21d244df96648636d9e7 /cpp/src/qpid/cluster/Multicaster.cpp | |
parent | 21dd878012fad826d335bc8aa7d9e9b88da7d6ff (diff) | |
download | qpid-python-92be0a347cdfd9c407611982c72938ecde777a8c.tar.gz |
PollableQueue optimization - replace deque with vector.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@778464 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Multicaster.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/Multicaster.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp/src/qpid/cluster/Multicaster.cpp b/cpp/src/qpid/cluster/Multicaster.cpp index f72867de4d..fee13c92c8 100644 --- a/cpp/src/qpid/cluster/Multicaster.cpp +++ b/cpp/src/qpid/cluster/Multicaster.cpp @@ -71,9 +71,9 @@ void Multicaster::mcast(const Event& e) { } -void Multicaster::sendMcast(PollableEventQueue::Queue& values) { +Multicaster::PollableEventQueue::Batch::const_iterator Multicaster::sendMcast(const PollableEventQueue::Batch& values) { try { - PollableEventQueue::Queue::iterator i = values.begin(); + PollableEventQueue::Batch::const_iterator i = values.begin(); while( i != values.end()) { iovec iov = i->toIovec(); if (!cpg.mcast(&iov, 1)) { @@ -82,12 +82,13 @@ void Multicaster::sendMcast(PollableEventQueue::Queue& values) { } ++i; } - values.erase(values.begin(), i); // Erase sent events. + return i; } catch (const std::exception& e) { QPID_LOG(critical, "Multicast error: " << e.what()); queue.stop(); onError(); + return values.end(); } } |