From e5815346cd4870640051856abed0887717aa0bf7 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 18 Aug 2010 23:41:05 +0200 Subject: Improve the performance of AdBlockRuleTextMatchImpl Comparing unicode string without case sensitive is rather expensive because each codepoint must be converted, which is non trivial for unicode. This patch introduce a new argument of ::match() taking the encoded url in lowercase. This way, the conversion can be done only once for a lot of rules. --- src/adblock/adblockrulefallbackimpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/adblock/adblockrulefallbackimpl.cpp') diff --git a/src/adblock/adblockrulefallbackimpl.cpp b/src/adblock/adblockrulefallbackimpl.cpp index decb895d..988f2895 100644 --- a/src/adblock/adblockrulefallbackimpl.cpp +++ b/src/adblock/adblockrulefallbackimpl.cpp @@ -61,7 +61,7 @@ AdBlockRuleFallbackImpl::AdBlockRuleFallbackImpl(const QString &filter) m_regExp.setPattern(parsedLine); } -bool AdBlockRuleFallbackImpl::match(const QString &encodedUrl) const +bool AdBlockRuleFallbackImpl::match(const QString &encodedUrl, const QString &) const { return m_regExp.indexIn(encodedUrl) != -1; } -- cgit v1.2.1