summaryrefslogtreecommitdiff
path: root/registry
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2019-10-17 20:33:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-23 08:55:00 +0200
commitc68be56c295c8dda3043c80d4641575ec2799e55 (patch)
tree40fc9a82e021498f7cebe76e59bec5bb85d6385c /registry
parent437dc68285dab0f08a1ded2193d86d64f560cd9b (diff)
size some stringbuffer to prevent re-alloc
Change-Id: I385587a922c555c320a45dcc6d644315b72510e9 Reviewed-on: https://gerrit.libreoffice.org/81278 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'registry')
-rw-r--r--registry/source/keyimpl.cxx3
-rw-r--r--registry/source/regimpl.cxx2
2 files changed, 3 insertions, 2 deletions
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx
index d969cbaa32c5..d7baabe008da 100644
--- a/registry/source/keyimpl.cxx
+++ b/registry/source/keyimpl.cxx
@@ -970,7 +970,8 @@ OStoreDirectory ORegKey::getStoreDir() const
OUString ORegKey::getFullPath(OUString const & path) const {
OSL_ASSERT(!m_name.isEmpty() && !path.isEmpty());
- OUStringBuffer b(m_name);
+ OUStringBuffer b(32);
+ b.append(m_name);
if (!b.isEmpty() && b[b.getLength() - 1] == '/') {
if (path[0] == '/') {
b.append(std::u16string_view(path).substr(1));
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
index ab7dcb09888e..43e12cb8f375 100644
--- a/registry/source/regimpl.cxx
+++ b/registry/source/regimpl.cxx
@@ -629,7 +629,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName,
}
OStoreDirectory rStoreDir;
- OUStringBuffer sFullPath(sFullKeyName.getLength());
+ OUStringBuffer sFullPath(sFullKeyName.getLength()+16);
OUString token;
sFullPath.append('/');