summaryrefslogtreecommitdiffstats
path: root/desktop
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-21 08:36:01 +0200
commit0f874472c672175135520101837ff0c9d4701d7f (patch)
treefa6a504bdfc7d5d838caed7cfb87793321797290 /desktop
parentDon't create unnecessary tempfiles for opened doc (diff)
downloadcore-0f874472c672175135520101837ff0c9d4701d7f.tar.gz
core-0f874472c672175135520101837ff0c9d4701d7f.zip
size some stringbuffer to prevent re-alloc
found by the simple expidient of putting asserts in the resize routine. Where an explicit const size is used, I started with 32 and kept doubling until that site did not need resizing anymore. Change-Id: I998787edc940d0a3ba23b5ac37131ab9ecd300f4 Reviewed-on: https://gerrit.libreoffice.org/81138 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/misc/dp_misc.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index a23855109c36..7b4aafb3b083 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -243,7 +243,7 @@ namespace {
OUString encodeForRcFile( OUString const & str )
{
// escape $\{} (=> rtl bootstrap files)
- OUStringBuffer buf;
+ OUStringBuffer buf(64);
sal_Int32 pos = 0;
const sal_Int32 len = str.getLength();
for ( ; pos < len; ++pos ) {
@@ -265,7 +265,7 @@ OUString encodeForRcFile( OUString const & str )
OUString makeURL( OUString const & baseURL, OUString const & relPath_ )
{
- OUStringBuffer buf;
+ OUStringBuffer buf(128);
if (baseURL.getLength() > 1 && baseURL[ baseURL.getLength() - 1 ] == '/')
buf.append( std::u16string_view(baseURL).substr(0, baseURL.getLength() - 1) );
else