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 /sfx2/source | |
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 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 3109ac7ff28a..4f9c109a23d1 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -452,7 +452,7 @@ void LinkManager::InsertFileLink( if (!(OBJECT_CLIENT_SO & rLink.GetObjType())) return; - OUStringBuffer aBuf; + OUStringBuffer aBuf(64); aBuf.append(rFileNm); aBuf.append(sfx2::cTokenSeparator); diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index ad5417688fdc..8e6bf6f29c39 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -509,7 +509,7 @@ dateTimeToText(css::util::DateTime const& i_rdt, sal_Int16 const*const pTimeZone = nullptr) throw () { if (isValidDateTime(i_rdt)) { - OUStringBuffer buf; + OUStringBuffer buf(32); ::sax::Converter::convertDateTime(buf, i_rdt, pTimeZone, true); return buf.makeStringAndClear(); } else { diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 09e6d59129f3..6dea1bc3d125 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -213,7 +213,7 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* pThisView, void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload) { - OStringBuffer aBuf; + OStringBuffer aBuf(32); aBuf.append(rPayload); if (comphelper::LibreOfficeKit::isPartInInvalidation()) { |