diff options
author | BogDan Vatra <bogdan@kdab.com> | 2016-03-18 15:54:06 +0200 |
---|---|---|
committer | BogDan Vatra <bogdan@kdab.com> | 2016-03-22 17:52:40 +0000 |
commit | 71c3bb4f77f6544c1f46eff9fc4f385d4788fc98 (patch) | |
tree | 22992b028a7bb6c60f471bb2f23e914bf2af5565 /src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp | |
parent | 5e01873790c814ce7462c6b7d7041ba3ffddfa77 (diff) |
QHash has faster lookup than QMap
Change-Id: Ifd93b4da6ce3d49f4bee27698e1d76f9a16179af
Reviewed-by: Continuous Integration (KDAB) <build@kdab.com>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp')
-rw-r--r-- | src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp b/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp index 0aaeed8..cad2a6f 100644 --- a/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp +++ b/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp @@ -631,7 +631,7 @@ void QAbstractItemModelReplicaPrivate::requestedHeaderData(QRemoteObjectPendingC verticalSections.append(watcher->sections[i]); const int index = watcher->orientations[i] == Qt::Horizontal ? 0 : 1; const int role = watcher->roles[i]; - QMap<int, QVariant> &dat = m_headerData[index][watcher->sections[i]].data; + QHash<int, QVariant> &dat = m_headerData[index][watcher->sections[i]].data; dat[role] = data[i]; } QVector<QPair<int, int> > horRanges = listRanges(horizontalSections); @@ -662,7 +662,7 @@ QVariant findData(const CachedRowEntry &row, const QModelIndex &index, int role, { if (index.column() < row.size()) { const CacheEntry &entry = row[index.column()]; - QMap<int, QVariant>::ConstIterator it = entry.data.constFind(role); + QHash<int, QVariant>::ConstIterator it = entry.data.constFind(role); if (it != entry.data.constEnd()) { if (cached) *cached = true; @@ -826,8 +826,8 @@ QVariant QAbstractItemModelReplica::headerData(int section, Qt::Orientation orie if (section >= elem.size()) return QVariant(); - const QMap<int, QVariant> &dat = elem.at(section).data; - QMap<int, QVariant>::ConstIterator it = dat.constFind(role); + const QHash<int, QVariant> &dat = elem.at(section).data; + QHash<int, QVariant>::ConstIterator it = dat.constFind(role); if (it != dat.constEnd()) return it.value(); |