configmgr/source/access.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit cf954c71850521405176c6cbe4bf636806421c21
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed May 11 11:43:18 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu May 12 08:34:07 2022 +0200

    elide temporary std::vector in Access::getElementNames
    
    Change-Id: I9a875d5615930700e20f67c40b4b7a24458fd447
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134198
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 806ff8944d81..86e6bdb72772 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -409,13 +409,13 @@ css::uno::Sequence< OUString > Access::getElementNames()
     osl::MutexGuard g(*lock_);
     checkLocalizedPropertyAccess();
     std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
-    std::vector<OUString> names;
-    names.reserve(children.size());
+    css::uno::Sequence<OUString> names(children.size());
+    OUString* pArray = names.getArray();
     for (auto const& child : children)
     {
-        names.push_back(child->getNameInternal());
+        *pArray++ = child->getNameInternal();
     }
-    return comphelper::containerToSequence(names);
+    return names;
 }
 
 sal_Bool Access::hasByName(OUString const & aName)

Reply via email to