QFlatMap: fix pointless reallocations on repeated range-insert()s
When looping over range-insert(), the repeated shrink_to_fit() calls would cause cause reserved (or geometrically-grown) capacity to be shed, breaking the underlying container's growth strategy. Fix by not shedding excess capacity. Pick-to: 6.3 6.2 Change-Id: I10915a06fc9442039c192486a55e48083da7c839 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
1abaf9d5d6
commit
e809d4e3cc
@ -971,8 +971,6 @@ private:
|
|||||||
k = i + 1;
|
k = i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
c.keys.shrink_to_fit();
|
|
||||||
c.values.shrink_to_fit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
containers c;
|
containers c;
|
||||||
|
Loading…
Reference in New Issue
Block a user