diff options
author | Noel Grandin <noel@peralex.com> | 2021-11-20 08:16:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-21 15:47:25 +0100 |
commit | dc2010964fb8d18d5c4fe96172ee082276a1e587 (patch) | |
tree | e90e1d4ec418e1d9265f11daced515901faf1153 /include | |
parent | efd95650cba2460bc153de00f8eb27785ad0e18a (diff) |
tdf#133835 speedup calc autofilter (5)
Tweak INetURLObject to reduce the number of
OUString and OUStringBuffer we create,
saves 5%
And add a asView() method to OUStringConstExpr,
to make it easier to pass to OUStringBuffer::insert
Change-Id: I115ec2398cfc8df39bd1efbbd5f0d5cc9712dba7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125600
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/rtl/ustring.hxx | 5 | ||||
-rw-r--r-- | include/tools/urlobj.hxx | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index e5b58be8c52d..e14549482f35 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -161,6 +161,11 @@ public: // no destructor necessary because we know we are pointing at a compile-time // constant OUStringLiteral, which bypasses ref-counting. + /** + make it easier to pass to OUStringBuffer and similar without casting/converting + */ + constexpr std::u16string_view asView() const { return {pData->buffer, static_cast<sal_uInt32>(pData->length)}; } + inline operator const OUString&() const; private: diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx index ede630b7ea7b..8049e165d7a0 100644 --- a/include/tools/urlobj.hxx +++ b/include/tools/urlobj.hxx @@ -404,7 +404,7 @@ public: @return The protocol name of URLs of the given scheme. */ - static OUString GetSchemeName(INetProtocol eTheScheme); + static const OUString & GetSchemeName(INetProtocol eTheScheme); static INetProtocol CompareProtocolScheme(OUString const & rTheAbsURIRef); |