diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-25 09:25:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-25 13:01:35 +0200 |
commit | 2e2304f00960d8e0e8c3ff76e632ef8f92608084 (patch) | |
tree | d3b2f90ebce7be1beba6c42146fd243ef3d0021c /framework | |
parent | a2b3e397d86800f9a56e83d166dcabb4f077172f (diff) |
elide temporary vector in PathSettings::impl_convertPath2OldStyle
Change-Id: Ib86933ef564b0d27c47dbbaddaa55f03b8426c7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134927
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/pathsettings.cxx | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index b5c30dc25809..aedaf3a31d67 100644 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -942,30 +942,25 @@ void PathSettings::impl_subst(PathSettings::PathInfo& aPath , OUString PathSettings::impl_convertPath2OldStyle(const PathSettings::PathInfo& rPath) const { - std::vector<OUString> lTemp; - lTemp.reserve(rPath.lInternalPaths.size() + rPath.lUserPaths.size() + 1); + OUStringBuffer sPathVal(256); for (auto const& internalPath : rPath.lInternalPaths) { - lTemp.push_back(internalPath); + if (sPathVal.getLength()) + sPathVal.append(";"); + sPathVal.append(internalPath); } for (auto const& userPath : rPath.lUserPaths) { - lTemp.push_back(userPath); + if (sPathVal.getLength()) + sPathVal.append(";"); + sPathVal.append(userPath); } - if (!rPath.sWritePath.isEmpty()) - lTemp.push_back(rPath.sWritePath); - - OUStringBuffer sPathVal(256); - for ( auto pIt = lTemp.begin(); - pIt != lTemp.end(); - ) { - sPathVal.append(*pIt); - ++pIt; - if (pIt != lTemp.end()) + if (sPathVal.getLength()) sPathVal.append(";"); + sPathVal.append(rPath.sWritePath); } return sPathVal.makeStringAndClear(); |