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 <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2021-11-19 15:57:48 +02:00 committed by Noel Grandin
parent b692c8a280
commit 66317d3aa5
2 changed files with 14 additions and 14 deletions

View file

@ -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.
*/

View file

@ -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;
}