Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Yershov <yershov@corp.mail.ru>2015-12-24 13:31:48 +0300
committerSergey Yershov <yershov@corp.mail.ru>2015-12-24 13:31:48 +0300
commit671560f497f3413c48470d3b66642f806e4c08f0 (patch)
tree46ef0e9c4d278850c3a4167e6a888cf9127c807a /indexer/feature_data.cpp
parent072cac5e242a1105ad9c99d32f355d96072032b4 (diff)
Remove duplicated types
Diffstat (limited to 'indexer/feature_data.cpp')
-rw-r--r--indexer/feature_data.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/indexer/feature_data.cpp b/indexer/feature_data.cpp
index 872468bfe8..786878fb40 100644
--- a/indexer/feature_data.cpp
+++ b/indexer/feature_data.cpp
@@ -360,6 +360,11 @@ bool FeatureParams::FinishAddingTypes()
newTypes.push_back(candidate);
}
+ // Remove duplicated types.
+ sort(newTypes.begin(), newTypes.end());
+ auto last = unique(newTypes.begin(), newTypes.end());
+ newTypes.erase(last, newTypes.end());
+
m_Types.swap(newTypes);
if (m_Types.size() > max_types_count)