From cd75479142e4974409b8abb61f8db3f943ffdaa0 Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Tue, 31 May 2011 12:41:52 +0200 Subject: [PATCH] [search] Ignore features that don't have visible text. --- search/query.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/search/query.cpp b/search/query.cpp index eccf93e7c8..bb39ac3a97 100644 --- a/search/query.cpp +++ b/search/query.cpp @@ -61,6 +61,10 @@ struct FeatureProcessor void operator () (FeatureType const & feature) const { + int const minVisibleScale = feature::MinDrawableScaleForText(feature); + if (minVisibleScale < 0) + return; + uint32_t const maxKeywordMatchScore = 512; uint32_t const maxPrefixMatchScore = min(static_cast(maxKeywordMatchScore), 256 * max(0, int(m_query.m_prefix.size()) - 1)); @@ -74,10 +78,6 @@ struct FeatureProcessor uint32_t const matchScore = matcher.GetMatchScore(); if (matchScore <= maxKeywordMatchScore) { - int const minVisibleScale = feature::MinDrawableScaleForText(feature); - // if (minVisibleScale < 0) - // return; - m_query.AddResult(IntermediateResult(feature, matcher.GetBestPrefixMatch(), matchScore, minVisibleScale)); }