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
This commit is contained in:
parent
22a6cab15f
commit
6f173fc609
1 changed files with 1 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue