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

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

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

We can do better by using [QHash::value](http://doc.qt.io/qt-5/qhash.html#value).

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: pino, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13820
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)
......
Markdown is supported
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