summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-07 09:31:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-09 08:36:58 +0200
commit919ffe3715c8583f0ee329e32bb6163608911d22 (patch)
tree401134bcd7291e9bb05257ec1aa88ea6e31732a2 /include
parent0b859bf33ed722c5c90f41cb08099fecfe494272 (diff)
std::list->std::vector in WeakBag
Change-Id: Ic0f0c89cb27fab4d30da1276fb8dc3ad1981a80d Reviewed-on: https://gerrit.libreoffice.org/52529 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/comphelper/weakbag.hxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/include/comphelper/weakbag.hxx b/include/comphelper/weakbag.hxx
index f23f9227057e..981a6c834e36 100644
--- a/include/comphelper/weakbag.hxx
+++ b/include/comphelper/weakbag.hxx
@@ -22,7 +22,7 @@
#include <sal/config.h>
-#include <list>
+#include <vector>
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weakref.hxx>
#include <osl/diagnose.h>
@@ -46,7 +46,7 @@ public:
*/
void add(css::uno::Reference< T > const & e) {
OSL_ASSERT(e.is());
- for (typename WeakReferenceList::iterator i(m_list.begin()); i != m_list.end();) {
+ for (auto i = m_list.begin(); i != m_list.end();) {
if (css::uno::Reference< T >(*i).is()) {
++i;
} else {
@@ -64,8 +64,8 @@ public:
*/
css::uno::Reference< T > remove() {
while (!m_list.empty()) {
- css::uno::Reference< T > r(m_list.front());
- m_list.pop_front();
+ css::uno::Reference< T > r(m_list.back());
+ m_list.pop_back();
if (r.is()) {
return r;
}
@@ -74,9 +74,7 @@ public:
}
private:
- typedef std::list< css::uno::WeakReference< T > > WeakReferenceList;
-
- WeakReferenceList m_list;
+ std::vector< css::uno::WeakReference< T > > m_list;
};
}