Commit 6f173fc6 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Use QHash::value() in EffectWindowImpl::data()

The `role` hash key is hashed twice:
* first, when calling `contains` method;
* second, when using `operator[]`.

We can do better by using [QHash::value](

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: pino, davidedmundson, kwin

Tags: #kwin

Differential Revision:
parent 22a6cab1
......@@ -1736,9 +1736,7 @@ void EffectWindowImpl::setData(int role, const QVariant &data)
QVariant EffectWindowImpl::data(int role) const
if (!dataMap.contains(role))
return QVariant();
return dataMap[ role ];
return dataMap.value(role);
EffectWindow* effectWindow(Toplevel* w)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment