Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 33c7edaa authored by Martin Flöser's avatar Martin Flöser

Use reserve on QVector<Phase2Data>

Summary:
We know that the maximum size is the number of windows in stacking
order. It might be that some are skipped as they are not ready for
painting, but overall it's better to reserve a little bit too much
memory than to have a growing QVector.

Test Plan: Compiles

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18208
parent d17a3ff8
......@@ -207,6 +207,7 @@ void Scene::paintGenericScreen(int orig_mask, ScreenPaintData)
paintBackground(infiniteRegion());
}
QVector<Phase2Data> phase2;
phase2.reserve(stacking_order.size());
foreach (Window * w, stacking_order) { // bottom to top
Toplevel* topw = w->window();
......@@ -250,6 +251,7 @@ void Scene::paintSimpleScreen(int orig_mask, QRegion region)
assert((orig_mask & (PAINT_SCREEN_TRANSFORMED
| PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS)) == 0);
QVector<Phase2Data> phase2data;
phase2data.reserve(stacking_order.size());
QRegion dirtyArea = region;
bool opaqueFullscreen(false);
......
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