diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-06-02 21:23:42 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-06-02 23:22:03 +0200 |
commit | da9fe0da11687bfc4c0eff2197286da67d6206c2 (patch) | |
tree | 28ed9b9f9a3808ba4c67e7ab1e8a8826e956534e | |
parent | Update git submodules (diff) | |
download | core-da9fe0da11687bfc4c0eff2197286da67d6206c2.tar.gz core-da9fe0da11687bfc4c0eff2197286da67d6206c2.zip |
Initialize vector directly with the already known count number
instead of initializing an empty vector then reserve a fixed value
Change-Id: Iccddda05b3dd98aa9c25a61637ece7af4d42d72f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116624
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r-- | dbaccess/source/core/api/HelperCollections.cxx | 2 | ||||
-rw-r--r-- | extensions/source/propctrlr/formlinkdialog.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/dbaccess/source/core/api/HelperCollections.cxx b/dbaccess/source/core/api/HelperCollections.cxx index dfc18badc688..12ab6414dfed 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; aNames.reserve( _rColumns->size() ); + std::vector< OUString > aNames(_rColumns->size()); OUString sColumName; for (auto const& column : *_rColumns) diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index 7f2d794b4010..f367179b7a1c 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; aDetailFields.reserve( 4 ); - std::vector< OUString > aMasterFields; aMasterFields.reserve( 4 ); + std::vector< OUString > aDetailFields(4); + std::vector< OUString > aMasterFields(4); const FieldLinkRow* aRows[] = { m_xRow1.get(), m_xRow2.get(), m_xRow3.get(), m_xRow4.get() |