diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-10-17 20:33:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-03 17:11:32 +0100 |
commit | 48101a1a0d574db3db1f99c782bd67e885b232bb (patch) | |
tree | afd2f88944d73f43762b3a31df2ff81c8115ba9e /tools | |
parent | ab285c743afa1c8769581871d7b56374fd8c49f1 (diff) |
size some stringbuffer to prevent re-alloc
I started with 32 and kept doubling the size until the site
did not need re-alloc, but clamped it at 512.
Change-Id: I55fe36b31cd3d40f86e5729337a927cf920f2af6
Reviewed-on: https://gerrit.libreoffice.org/81960
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/debug/debug.cxx | 2 | ||||
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index 3ab901c1aee9..6bfb9a42612f 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -398,7 +398,7 @@ static void exceptionToStringImpl(OStringBuffer& sMessage, const css::uno::Any & OString exceptionToString(const css::uno::Any & caught) { - OStringBuffer sMessage; + OStringBuffer sMessage(512); exceptionToStringImpl(sMessage, caught); return sMessage.makeStringAndClear(); } diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 636bfe42ff32..e07cfd04035e 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -1369,7 +1369,7 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, } break; } - OUStringBuffer aSynHost; + OUStringBuffer aSynHost(64); if (!parseHostOrNetBiosName( pHostPortBegin, pPort, eMechanism, eCharset, bNetBiosName, &aSynHost)) @@ -1614,7 +1614,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef, enum State { STATE_AUTH, STATE_ABS_PATH, STATE_REL_PATH, STATE_FRAGMENT, STATE_DONE }; - OUStringBuffer aSynAbsURIRef; + OUStringBuffer aSynAbsURIRef(128); // make sure that the scheme is copied for generic schemes: getSchemeInfo().m_pScheme // is empty ("") in that case, so take the scheme from m_aAbsURIRef if (m_eScheme != INetProtocol::Generic) @@ -2342,7 +2342,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p STATE_IP6_HEXSEQ1_MAYBE_IP4, STATE_IP6_HEXSEQ2, STATE_IP6_HEXSEQ2_COLON, STATE_IP6_HEXSEQ2_MAYBE_IP4, STATE_IP6_IP4, STATE_IP6_IP4_DOT, STATE_IP6_DONE }; - OUStringBuffer aTheCanonic; + OUStringBuffer aTheCanonic(32); sal_uInt32 nNumber = 0; int nDigits = 0; int nOctets = 0; @@ -4320,7 +4320,7 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle, if (pDelimiter) *pDelimiter = '\\'; - OUStringBuffer aSynFSysPath; + OUStringBuffer aSynFSysPath(64); if (m_aHost.isPresent() && m_aHost.getLength() > 0) { aSynFSysPath.append("\\\\"); |