From 66441d7a828ddcdae709cf4699420147f376bdcd Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 3 Dec 2015 13:06:12 +0100 Subject: Make use of new QHash::erase(const_iterator) overload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drive-by changes: - use auto for iterators - add Q_UNLIKELY for conditions leading to a qWarning etc Change-Id: Iff8f36d67c96674d354a501b26640f73c15ce58d Reviewed-by: Thiago Macieira Reviewed-by: Sérgio Martins --- src/widgets/itemviews/qitemeditorfactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/itemviews/qitemeditorfactory.cpp') 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::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); -- cgit v1.2.3