summaryrefslogtreecommitdiff
path: root/ucb/source
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 /ucb/source
parent9112c18524c9f5e67d6cbb282586a439e3020cdb (diff)
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 'ucb/source')
-rw-r--r--ucb/source/core/ucb.cxx2
-rw-r--r--ucb/source/ucp/inc/urihelper.hxx2
-rw-r--r--ucb/source/ucp/webdav-neon/NeonUri.cxx3
3 files changed, 4 insertions, 3 deletions
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index 991ea410149d..062db439784b 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -786,7 +786,7 @@ bool UniversalContentBroker::getContentProviderData(
uno::Reference< lang::XMultiServiceFactory > xConfigProv =
configuration::theDefaultProvider::get( m_xContext );
- OUStringBuffer aFullPath;
+ OUStringBuffer aFullPath(128);
aFullPath.append(
"/org.openoffice.ucb.Configuration/ContentProviders"
"/['" );
diff --git a/ucb/source/ucp/inc/urihelper.hxx b/ucb/source/ucp/inc/urihelper.hxx
index 146708c6ee48..19d459181b2f 100644
--- a/ucb/source/ucp/inc/urihelper.hxx
+++ b/ucb/source/ucp/inc/urihelper.hxx
@@ -80,7 +80,7 @@ namespace ucb_impl { namespace urihelper {
rtl_UriEncodeKeepEscapes, /* #i81690# */
RTL_TEXTENCODING_UTF8 );
- OUStringBuffer aResult;
+ OUStringBuffer aResult(256);
sal_Int32 nIndex = 0;
do
{
diff --git a/ucb/source/ucp/webdav-neon/NeonUri.cxx b/ucb/source/ucp/webdav-neon/NeonUri.cxx
index 17db426dcf5b..f7e94b38ddca 100644
--- a/ucb/source/ucp/webdav-neon/NeonUri.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonUri.cxx
@@ -149,7 +149,8 @@ void NeonUri::init( const OString & rUri, const ne_uri * pUri )
void NeonUri::calculateURI ()
{
- OUStringBuffer aBuf( mScheme );
+ OUStringBuffer aBuf( 256 );
+ aBuf.append( mScheme );
aBuf.append( "://" );
if ( !mUserInfo.isEmpty() )
{