erase vector instead of clearing it to preserve the pre-allocated memory

CCBUG: 299594
REVIEW: 104897
This commit is contained in:
Thomas Lübking 2012-05-08 19:13:09 +02:00
parent 601243e549
commit ee53114054

View file

@ -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