diff options
author | vng <viktor.govako@gmail.com> | 2014-09-12 11:27:56 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:26:46 +0300 |
commit | 89edfffd668c7531bd876dce3615881e0c5a3464 (patch) | |
tree | cc675962ea9127427d852811b54b57bd0925ef04 /indexer/feature_data.cpp | |
parent | a23fcd4e09ff431d71664a15f123ea616e24f08d (diff) |
[categories] “WiFi” category should be the last option when showing feature type.
Diffstat (limited to 'indexer/feature_data.cpp')
-rw-r--r-- | indexer/feature_data.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/indexer/feature_data.cpp b/indexer/feature_data.cpp index 9aada94f03..42752de21b 100644 --- a/indexer/feature_data.cpp +++ b/indexer/feature_data.cpp @@ -41,16 +41,33 @@ namespace class UselessTypesChecker { vector<uint32_t> m_types; -public: - UselessTypesChecker() + + template <size_t N, size_t M> + void AddTypes(char const * (&arr)[N][M]) { Classificator const & c = classif(); - char const * arr1[][1] = { { "building" }, { "oneway" }, { "lit" } }; + for (size_t i = 0; i < N; ++i) + m_types.push_back(c.GetTypeByPath(vector<string>(arr[i], arr[i] + M))); + } - for (size_t i = 0; i < ARRAY_SIZE(arr1); ++i) - m_types.push_back(c.GetTypeByPath(vector<string>(arr1[i], arr1[i] + 1))); +public: + UselessTypesChecker() + { + char const * arr1[][1] = { + { "building" }, + { "oneway" }, + { "lit" }, + { "internet_access" }, + }; + char const * arr2[][2] = { + { "internet_access", "wlan"}, + }; + + AddTypes(arr1); + AddTypes(arr2); } + bool operator() (uint32_t t) const { return (find(m_types.begin(), m_types.end(), t) != m_types.end()); |