From 12d4c4023274ab1c56875ca3f68851a567a620db Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Fri, 3 Jun 2011 18:19:47 +0200 Subject: [PATCH] [search] feature::MinDrawableScaleForText() is slow, check it only if the feature matches. --- search/query.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/search/query.cpp b/search/query.cpp index c05b0f608a..21d40f85dc 100644 --- a/search/query.cpp +++ b/search/query.cpp @@ -64,10 +64,6 @@ struct FeatureProcessor void operator () (FeatureType const & feature) const { - int const minVisibleScale = feature::MinDrawableScaleForText(feature); - if (minVisibleScale < 0) - return; - KeywordMatcher matcher(MakeMatcher(m_query.m_keywords, m_query.m_prefix)); feature.ForEachNameRef(matcher); if (matcher.GetPrefixMatchScore() <= GetMaxKeywordMatchScore()) @@ -75,6 +71,10 @@ struct FeatureProcessor uint32_t const matchScore = matcher.GetMatchScore(); if (matchScore <= GetMaxKeywordMatchScore()) { + int const minVisibleScale = feature::MinDrawableScaleForText(feature); + if (minVisibleScale < 0) + return; + m_query.AddResult(IntermediateResult(feature, matcher.GetBestPrefixMatch(), matchScore, minVisibleScale)); }