[Libreoffice-commits] online.git: common/MessageQueue.cpp common/MessageQueue.hpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Nov 28 04:57:35 UTC 2016
common/MessageQueue.cpp | 6 +++---
common/MessageQueue.hpp | 3 +--
2 files changed, 4 insertions(+), 5 deletions(-)
New commits:
commit f4dd9c1e11cd266ad79d5a20f7af613d9d530d92
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sat Nov 26 22:47:17 2016 -0500
loolwsd: use vector instead of deque for MessageQueue
Change-Id: I879d248e54748916b30c64874ddc237fb662ac11
Reviewed-on: https://gerrit.libreoffice.org/31289
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/common/MessageQueue.cpp b/common/MessageQueue.cpp
index 12a2abb..d9696e1 100644
--- a/common/MessageQueue.cpp
+++ b/common/MessageQueue.cpp
@@ -78,7 +78,7 @@ bool MessageQueue::wait_impl() const
MessageQueue::Payload MessageQueue::get_impl()
{
Payload result = _queue.front();
- _queue.pop_front();
+ _queue.erase(_queue.begin());
return result;
}
@@ -206,7 +206,7 @@ void TileQueue::deprioritizePreviews()
break;
}
- _queue.pop_front();
+ _queue.erase(_queue.begin());
_queue.push_back(front);
}
}
@@ -224,7 +224,7 @@ MessageQueue::Payload TileQueue::get_impl()
{
// Don't combine non-tiles or tiles with id.
LOG_TRC("MessageQueue res: " << msg);
- _queue.pop_front();
+ _queue.erase(_queue.begin());
// de-prioritize the other tiles with id - usually the previews in
// Impress
diff --git a/common/MessageQueue.hpp b/common/MessageQueue.hpp
index 96834ae..3cd023b 100644
--- a/common/MessageQueue.hpp
+++ b/common/MessageQueue.hpp
@@ -13,7 +13,6 @@
#include <algorithm>
#include <condition_variable>
#include <functional>
-#include <deque>
#include <map>
#include <mutex>
#include <vector>
@@ -65,7 +64,7 @@ protected:
void clear_impl();
- std::deque<Payload> _queue;
+ std::vector<Payload> _queue;
};
/** MessageQueue specialized for priority handling of tiles.
More information about the Libreoffice-commits
mailing list