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:
parent
b566d670e5
commit
0d1024e0f1
@ -512,7 +512,7 @@ QVector<QRect> MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const Q
|
|||||||
if (overlap >= maxOverlap || maxOverlap == -1) {
|
if (overlap >= maxOverlap || maxOverlap == -1) {
|
||||||
if (overlap > maxOverlap) {
|
if (overlap > maxOverlap) {
|
||||||
maxOverlap = overlap;
|
maxOverlap = overlap;
|
||||||
result.clear();
|
result.resize(0);
|
||||||
}
|
}
|
||||||
result << srcRect;
|
result << srcRect;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user