From ee5311405459aba8d538c5ed1fb4578b9f2221c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Tue, 8 May 2012 19:13:09 +0200 Subject: [PATCH] erase vector instead of clearing it to preserve the pre-allocated memory CCBUG: 299594 REVIEW: 104897 --- composite.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composite.cpp b/composite.cpp index 4dc38190a3..7e48066a50 100644 --- a/composite.cpp +++ b/composite.cpp @@ -655,7 +655,7 @@ void Toplevel::damageNotifyEvent(XDamageNotifyEvent* e) const float area = rect().width()*rect().height(); damageRects.reserve(16); - damageRects.clear(); + damageRects.erase(damageRects.begin(), damageRects.end()); damageRects << QRect(e->area.x, e->area.y, e->area.width, e->area.height); // we can not easily say anything about the overall ratio since the new rects may intersect the present