QMdiArea: fix unintended reallocations

The capacity of 'result' is reserved, but QVector::clear() always
deallocates. Fix by using resize(int) instead, which at least
preserves capacity when it has been reserve()d.

Change-Id: I198d532661f4f767588c4ce244c2454eb8823e54
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Marc Mutz 2015-12-03 13:49:33 +01:00
parent b566d670e5
commit 0d1024e0f1

View File

@ -512,7 +512,7 @@ QVector<QRect> MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const Q
if (overlap >= maxOverlap || maxOverlap == -1) {
if (overlap > maxOverlap) {
maxOverlap = overlap;
result.clear();
result.resize(0);
}
result << srcRect;
}