summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qwidgettextcontrol.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/widgets/qwidgettextcontrol.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/widgets/qwidgettextcontrol.cpp')
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index deca002bf5..1c249eee78 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -2401,8 +2401,8 @@ void QWidgetTextControl::setExtraSelections(const QList<QTextEdit::ExtraSelectio
for (int i = 0; i < selections.count(); ++i) {
const QTextEdit::ExtraSelection &sel = selections.at(i);
- QHash<int, int>::iterator it = hash.find(sel.cursor.anchor());
- if (it != hash.end()) {
+ const auto it = hash.constFind(sel.cursor.anchor());
+ if (it != hash.cend()) {
const QAbstractTextDocumentLayout::Selection &esel = d->extraSelections.at(it.value());
if (esel.cursor.position() == sel.cursor.position()
&& esel.format == sel.format) {