summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qitemeditorfactory.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-12-03 13:06:12 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-12-19 07:41:50 +0000
commit66441d7a828ddcdae709cf4699420147f376bdcd (patch)
treefc16433f11c0eb8dd05971566528c70686a72dcc /src/widgets/itemviews/qitemeditorfactory.cpp
parent0f923a8ce45a0b9379bf0a43e68897a3a8333fda (diff)
Make use of new QHash::erase(const_iterator) overload
Drive-by changes: - use auto for iterators - add Q_UNLIKELY for conditions leading to a qWarning etc Change-Id: Iff8f36d67c96674d354a501b26640f73c15ce58d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sérgio Martins <iamsergio@gmail.com>
Diffstat (limited to 'src/widgets/itemviews/qitemeditorfactory.cpp')
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index 701e7ab79b..3287d5dc99 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -198,8 +198,8 @@ QItemEditorFactory::~QItemEditorFactory()
*/
void QItemEditorFactory::registerEditor(int userType, QItemEditorCreatorBase *creator)
{
- QHash<int, QItemEditorCreatorBase *>::iterator it = creatorMap.find(userType);
- if (it != creatorMap.end()) {
+ const auto it = creatorMap.constFind(userType);
+ if (it != creatorMap.cend()) {
QItemEditorCreatorBase *oldCreator = it.value();
Q_ASSERT(oldCreator);
creatorMap.erase(it);