summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/itemviews/qabstractitemview_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h
index a3af79abcb..60ae1559b1 100644
--- a/src/widgets/itemviews/qabstractitemview_p.h
+++ b/src/widgets/itemviews/qabstractitemview_p.h
@@ -277,7 +277,8 @@ public:
const QEditorInfo &editorForIndex(const QModelIndex &index) const;
inline bool hasEditor(const QModelIndex &index) const {
- return indexEditorHash.find(index) != indexEditorHash.constEnd();
+ // Search's implicit cast (QModelIndex to QPersistentModelIndex) is slow; use cheap pre-test to avoid when we can.
+ return !indexEditorHash.isEmpty() && indexEditorHash.contains(index);
}
QModelIndex indexForEditor(QWidget *editor) const;