From e809d4e3ccdb713407253150d82d8634dc3cf97e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 8 Jan 2022 14:51:23 +0100 Subject: 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 --- src/corelib/tools/qflatmap_p.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/corelib/tools/qflatmap_p.h') diff --git a/src/corelib/tools/qflatmap_p.h b/src/corelib/tools/qflatmap_p.h index ac5f701e85..936b1749df 100644 --- a/src/corelib/tools/qflatmap_p.h +++ b/src/corelib/tools/qflatmap_p.h @@ -971,8 +971,6 @@ private: k = i + 1; } } - c.keys.shrink_to_fit(); - c.values.shrink_to_fit(); } containers c; -- cgit v1.2.3