chart2/source/view/main/PropertyMapper.cxx |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 1626122615828c2c1689fb3aab2d05e0bdc1b4d3
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Wed Jan 5 20:41:44 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jan 6 07:16:14 2022 +0100

    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.gran...@collabora.co.uk>

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)
     {

Reply via email to