summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-11 11:43:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-12 08:34:07 +0200
commitcf954c71850521405176c6cbe4bf636806421c21 (patch)
tree9f121bf8b3431d44bf3d65ef2bbde17030a292a7 /configmgr
parent8969695b2b764a7bebf183d80b1161a142536566 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/access.cxx8
1 files changed, 4 insertions, 4 deletions
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)