diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-01-05 20:41:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-06 07:16:14 +0100 |
commit | 1626122615828c2c1689fb3aab2d05e0bdc1b4d3 (patch) | |
tree | e8f4e78cb8456082897a4bd4f4a6f67be3883bc8 | |
parent | 0b0934056b47485527442b6366d7fd3274a4601f (diff) |
avoid Sequence realloc
construct with the right size
Change-Id: I94f0743a9c77ad374d1f0f59a1a5ef531cccfeab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128022
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | chart2/source/view/main/PropertyMapper.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx index c54d15a8aa53..c8bd6e1d61eb 100644 --- a/chart2/source/view/main/PropertyMapper.cxx +++ b/chart2/source/view/main/PropertyMapper.cxx @@ -63,14 +63,12 @@ void PropertyMapper::setMappedProperties( if( !xSource.is() ) return; - tNameSequence aNames; - tAnySequence aValues; - sal_Int32 nN=0; sal_Int32 nPropertyCount = rMap.size(); - aNames.realloc(nPropertyCount); + tNameSequence aNames(nPropertyCount); + tAnySequence aValues(nPropertyCount); auto pNames = aNames.getArray(); - aValues.realloc(nPropertyCount); auto pValues = aValues.getArray(); + sal_Int32 nN=0; for (auto const& elem : rMap) { |