summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2020-05-05 14:07:25 +0200
committerPaul Lemire <paul.lemire@kdab.com>2020-06-04 11:13:16 +0200
commit0c9c4e163458f99ac350aef4979754cbe147dac3 (patch)
treef6acbf7b96f2ca146a2f2fefc666e3df817fa30d /src/core
parent83ee10ff799fa5892b14a677036fb445ae16b10b (diff)
QResourcesManager: switch to std::vector
Given QVector is potentially slower for this use case and the fact that QVector might become QList in Qt6, we're better of using the std. Change-Id: If2c403439ddb856b60f8bfd5ae7c6ec1cb2c892a Reviewed-by: Mike Krus <mike.krus@kdab.com> (cherry picked from commit 04bdb35a6c5f5fe417c06392e6a0861d80ec9dba)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/resources/qresourcemanager_p.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/resources/qresourcemanager_p.h b/src/core/resources/qresourcemanager_p.h
index 6e479d5ef..88bce2e1c 100644
--- a/src/core/resources/qresourcemanager_p.h
+++ b/src/core/resources/qresourcemanager_p.h
@@ -247,7 +247,7 @@ public:
void releaseResource(const Handle &handle)
{
- m_activeHandles.removeOne(handle);
+ m_activeHandles.erase(std::remove(m_activeHandles.begin(), m_activeHandles.end(), handle), m_activeHandles.end());
typename Handle::Data *d = handle.data_ptr();
d->nextFree = freeList;
freeList = d;
@@ -272,7 +272,7 @@ public:
}
int count() const { return m_activeHandles.size(); }
- QVector<Handle> activeHandles() const { return m_activeHandles; }
+ const std::vector<Handle> &activeHandles() const { return m_activeHandles; }
private:
Q_DISABLE_COPY(ArrayAllocatingPolicy)
@@ -290,7 +290,7 @@ private:
};
Bucket *firstBucket = 0;
- QVector<Handle > m_activeHandles;
+ std::vector<Handle> m_activeHandles;
typename Handle::Data *freeList = 0;
int allocCounter = 1;