From 66317d3aa5ada5b7c5ea317590730f563bebb77c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 19 Nov 2021 15:57:48 +0200 Subject: [PATCH] tdf#133835 speedup calc autofilter (1) avoid a copy in INetURLHistory::QueryUrl, saves 10% Change-Id: I662a4e48f198e61f1cef52b1e920613bce9c9766 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125563 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svl/inethist.hxx | 12 ++---------- svl/source/misc/inethist.cxx | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/svl/inethist.hxx b/include/svl/inethist.hxx index 92bbca72b09f..fe3398d43572 100644 --- a/include/svl/inethist.hxx +++ b/include/svl/inethist.hxx @@ -42,7 +42,7 @@ class SVL_DLLPUBLIC INetURLHistory final : public SfxBroadcaster SAL_DLLPRIVATE static void NormalizeUrl_Impl (INetURLObject &rUrl); void PutUrl_Impl (const INetURLObject &rUrl); - bool QueryUrl_Impl (const INetURLObject &rUrl) const; + bool QueryUrl_Impl (INetURLObject rUrl) const; /** Not implemented. */ @@ -74,15 +74,7 @@ public: return false; } - bool QueryUrl (const OUString &rUrl) const - { - INetProtocol eProto = - INetURLObject::CompareProtocolScheme (rUrl); - if (QueryProtocol (eProto)) - return QueryUrl_Impl (INetURLObject (rUrl)); - else - return false; - } + bool QueryUrl (const OUString &rUrl) const; /** PutUrl. */ diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index b7bb0aaa191e..2fbd981034ec 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -346,15 +346,23 @@ void INetURLHistory::PutUrl_Impl (const INetURLObject &rUrl) } } -bool INetURLHistory::QueryUrl_Impl (const INetURLObject &rUrl) const +bool INetURLHistory::QueryUrl(const OUString &rUrl) const +{ + INetProtocol eProto = INetURLObject::CompareProtocolScheme (rUrl); + if (!QueryProtocol (eProto)) + return false; + return QueryUrl_Impl( INetURLObject(rUrl) ); +} + + +bool INetURLHistory::QueryUrl_Impl (INetURLObject rUrl) const { DBG_ASSERT (m_pImpl, "QueryUrl_Impl(): no Implementation"); if (m_pImpl) { - INetURLObject aHistUrl (rUrl); - NormalizeUrl_Impl (aHistUrl); + NormalizeUrl_Impl (rUrl); - return m_pImpl->queryUrl (aHistUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE)); + return m_pImpl->queryUrl (rUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } return false; }