xcb: Use std::move and pass argument by rvalue reference

It will avoid a creation of temporary object and avoid copying.

Change-Id: Ifae5f6f9e36bcb07f4bacc31f151f8adcfa621a3
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
bb10
Mikhail Svetkin 2018-11-16 10:32:39 +01:00
parent ae1f749e9e
commit 2a1c368c87
2 changed files with 2 additions and 2 deletions

View File

@ -384,7 +384,7 @@ void QXcbConnection::initializeScreens()
}
siblings << screen;
}
virtualDesktop->setScreens(siblings);
virtualDesktop->setScreens(std::move(siblings));
xcb_screen_next(&it);
++xcbScreenNumber;
} // for each xcb screen

View File

@ -79,7 +79,7 @@ public:
QXcbScreen *screenAt(const QPoint &pos) const;
QList<QPlatformScreen *> screens() const { return m_screens; }
void setScreens(QList<QPlatformScreen *> sl) { m_screens = sl; }
void setScreens(QList<QPlatformScreen *> &&sl) { m_screens = std::move(sl); }
void removeScreen(QPlatformScreen *s) { m_screens.removeOne(s); }
void addScreen(QPlatformScreen *s);
void setPrimaryScreen(QPlatformScreen *s);