commit | e0ec952bae15d296006de86b80782551c144afa4 | [log] [tgz] |
---|---|---|
author | Shai Barack <shayba@google.com> | Mon Oct 07 15:25:28 2024 +0000 |
committer | Shai Barack <shayba@google.com> | Tue Oct 08 08:36:03 2024 +0000 |
tree | f82b34c0dc8ee4ec79f70d83dffc45bb4ab79e94 | |
parent | 7cc50a8c2959d31817e06974ae8d6563160ef338 [diff] |
Avoid unnecessary allocation in VectorImpl When shrinking a vector, we might reallocate the buffer if the current capacity is too large, or we might reuse the existing buffer. Never reallocate the buffer if the current capacity is already at the minimum (i.e. we won't actually shrink by reallocating). Bug: 370649413 Change-Id: I665037ed2a8621a82f2b58bcc834934de0761f34 Flag: EXEMPT bugfix Tested: see b/370649413#comment6