diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 4d9c09fcce..f6f058f7e2 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -138,6 +138,34 @@ namespace }; } +namespace +{ + class UselessCheckPatch + { + uint32_t m_oneway, m_highway; + + public: + UselessCheckPatch(Classificator const & c) + { + vector v; + v.push_back("oneway"); + m_oneway = c.GetTypeByPath(v); + + v.clear(); + v.push_back("highway"); + m_highway = c.GetTypeByPath(v); + } + + bool IsHighway(uint32_t t) const + { + ftype::TruncValue(t, 1); + return (t == m_highway); + } + + bool IsOneway(uint32_t t) const { return (t == m_oneway); } + }; +} + pair GetDrawRule(FeatureBase const & f, int level, drule::KeysT & keys, string & names) { @@ -146,13 +174,28 @@ pair GetDrawRule(FeatureBase const & f, int level, ASSERT ( keys.empty(), () ); Classificator const & c = classif(); + static UselessCheckPatch patch(c); + + bool hasHighway = false; + for (size_t i = 0; i < types.Size(); ++i) + if (patch.IsHighway(types[i])) + { + hasHighway = true; + break; + } + DrawRuleGetter doRules(level, types.GetGeoType(), keys #ifdef DEBUG , names #endif ); for (size_t i = 0; i < types.Size(); ++i) + { + if (!hasHighway && patch.IsOneway(types[i])) + continue; + (void)c.ProcessObjects(types[i], doRules); + } return make_pair(types.GetGeoType(), types.Has(c.GetCoastType())); }