summaryrefslogtreecommitdiffstats
path: root/src/gui/text
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/gui/text
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/gui/text')
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.cpp4
1 files changed, 2 insertions, 2 deletions
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);