summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/FifoDistributor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/FifoDistributor.cpp')
-rw-r--r--cpp/src/qpid/broker/FifoDistributor.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/cpp/src/qpid/broker/FifoDistributor.cpp b/cpp/src/qpid/broker/FifoDistributor.cpp
index eb1f0a402e..c9ba894297 100644
--- a/cpp/src/qpid/broker/FifoDistributor.cpp
+++ b/cpp/src/qpid/broker/FifoDistributor.cpp
@@ -30,11 +30,7 @@ FifoDistributor::FifoDistributor(Messages& container)
bool FifoDistributor::nextConsumableMessage( Consumer::shared_ptr&, QueuedMessage& next )
{
- if (!messages.empty()) {
- next = messages.front(); // by default, consume oldest msg
- return true;
- }
- return false;
+ return messages.consume(next);
}
bool FifoDistributor::allocate(const std::string&, const QueuedMessage& )
@@ -46,9 +42,7 @@ bool FifoDistributor::allocate(const std::string&, const QueuedMessage& )
bool FifoDistributor::nextBrowsableMessage( Consumer::shared_ptr& c, QueuedMessage& next )
{
- if (!messages.empty() && messages.next(c->getPosition(), next))
- return true;
- return false;
+ return messages.browse(c->getPosition(), next, !c->browseAcquired());
}
void FifoDistributor::query(qpid::types::Variant::Map&) const