[search] feature::MinDrawableScaleForText() is slow, check it only if the feature matches.

This commit is contained in:
Yury Melnichek 2011-06-03 18:19:47 +02:00 committed by Alex Zolotarev
parent f4184429ec
commit 12d4c40232

View file

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