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 /unotools | |
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 'unotools')
-rw-r--r-- | unotools/source/config/docinfohelper.cxx | 2 | ||||
-rw-r--r-- | unotools/source/misc/datetime.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/unotools/source/config/docinfohelper.cxx b/unotools/source/config/docinfohelper.cxx index cf77b11404d8..7e605d187c75 100644 --- a/unotools/source/config/docinfohelper.cxx +++ b/unotools/source/config/docinfohelper.cxx @@ -30,7 +30,7 @@ namespace utl OUString DocInfoHelper::GetGeneratorString() { - OUStringBuffer aResult; + OUStringBuffer aResult(128); // First product: branded name + version // version is <product_versions>_<product_extension>$<platform> diff --git a/unotools/source/misc/datetime.cxx b/unotools/source/misc/datetime.cxx index 7b2ef0eb2c40..ca5c2c110057 100644 --- a/unotools/source/misc/datetime.cxx +++ b/unotools/source/misc/datetime.cxx @@ -259,7 +259,7 @@ void typeConvert(const css::util::DateTime& _rDateTime, DateTime& _rOut) OUString toISO8601(const css::util::DateTime& rDateTime) { - OUStringBuffer rBuffer; + OUStringBuffer rBuffer(32); rBuffer.append(static_cast<sal_Int32>(rDateTime.Year)); rBuffer.append('-'); if( rDateTime.Month < 10 ) |