dbaccess/source/core/api/HelperCollections.cxx |    2 +-
 extensions/source/propctrlr/formlinkdialog.cxx |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 23390e3096c2db2526cbc0867e3b2063e06f6150
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Thu Jun 3 07:06:53 2021 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Jun 3 09:38:58 2021 +0200

    Revert "Initialize vector directly with the already known count number"
    
    This reverts commit da9fe0da11687bfc4c0eff2197286da67d6206c2.
    
    Reason for revert: wrong result since there'll be first 4 by default 
initializations then an extra reserve allocation.
    
    Change-Id: If480243e81db405d6a984b8450a219e486f1a1ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116465
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    Tested-by: Jenkins

diff --git a/dbaccess/source/core/api/HelperCollections.cxx 
b/dbaccess/source/core/api/HelperCollections.cxx
index 12ab6414dfed..dfc18badc688 100644
--- a/dbaccess/source/core/api/HelperCollections.cxx
+++ b/dbaccess/source/core/api/HelperCollections.cxx
@@ -53,7 +53,7 @@ namespace dbaccess
     std::unique_ptr<OPrivateColumns> 
OPrivateColumns::createWithIntrinsicNames( const ::rtl::Reference< 
::connectivity::OSQLColumns >& _rColumns,
         bool _bCase, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex )
     {
-        std::vector< OUString > aNames(_rColumns->size());
+        std::vector< OUString > aNames; aNames.reserve( _rColumns->size() );
 
         OUString sColumName;
         for (auto const& column : *_rColumns)
diff --git a/extensions/source/propctrlr/formlinkdialog.cxx 
b/extensions/source/propctrlr/formlinkdialog.cxx
index f367179b7a1c..7f2d794b4010 100644
--- a/extensions/source/propctrlr/formlinkdialog.cxx
+++ b/extensions/source/propctrlr/formlinkdialog.cxx
@@ -185,8 +185,8 @@ namespace pcr
     void FormLinkDialog::commitLinkPairs()
     {
         // collect the field lists from the rows
-        std::vector< OUString > aDetailFields(4);
-        std::vector< OUString > aMasterFields(4);
+        std::vector< OUString > aDetailFields; aDetailFields.reserve( 4 );
+        std::vector< OUString > aMasterFields; aMasterFields.reserve( 4 );
 
         const FieldLinkRow* aRows[] = {
             m_xRow1.get(), m_xRow2.get(), m_xRow3.get(), m_xRow4.get()
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to