summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2023-01-24 02:45:51 +0100
committerAleix Pol <aleixpol@kde.org>2023-01-24 14:30:29 +0100
commit6e2dcb410b8a65d6da3a19ded28ec1eea389c593 (patch)
tree27e27b44faad78fcd1139183636853a1d81887bc
parente4dda116ea4897ccb0f93c414d818b4788e2053d (diff)
QWaylandDataOffer: Save double look-up
Only look up the value on the QHash once. Change-Id: I7c7c2f72bb1aa8fad0d374d5ea84c093ea5a2f01 Reviewed-by: David Edmundson <davidedmundson@kde.org>
-rw-r--r--src/client/qwaylanddataoffer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/qwaylanddataoffer.cpp b/src/client/qwaylanddataoffer.cpp
index 533c0023a..046385e91 100644
--- a/src/client/qwaylanddataoffer.cpp
+++ b/src/client/qwaylanddataoffer.cpp
@@ -117,8 +117,9 @@ QVariant QWaylandMimeData::retrieveData_sys(const QString &mimeType, QMetaType t
{
Q_UNUSED(type);
- if (m_data.contains(mimeType))
- return m_data.value(mimeType);
+ auto it = m_data.constFind(mimeType);
+ if (it != m_data.constEnd())
+ return *it;
QString mime = mimeType;