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/gui/text/qabstracttextdocumentlayout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/text') diff --git a/src/gui/text/qabstracttextdocumentlayout.cpp b/src/gui/text/qabstracttextdocumentlayout.cpp index 7735fd6b46..ea6c5d1984 100644 --- a/src/gui/text/qabstracttextdocumentlayout.cpp +++ b/src/gui/text/qabstracttextdocumentlayout.cpp @@ -447,8 +447,8 @@ void QAbstractTextDocumentLayout::unregisterHandler(int objectType, QObject *com { Q_D(QAbstractTextDocumentLayout); - HandlerHash::iterator it = d->handlers.find(objectType); - if (it != d->handlers.end() && (!component || component == it->component)) { + const auto it = d->handlers.constFind(objectType); + if (it != d->handlers.cend() && (!component || component == it->component)) { if (component) disconnect(component, SIGNAL(destroyed(QObject*)), this, SLOT(_q_handlerDestroyed(QObject*))); d->handlers.erase(it); -- cgit v1.2.3