From 671560f497f3413c48470d3b66642f806e4c08f0 Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Thu, 24 Dec 2015 13:31:48 +0300 Subject: [PATCH] Remove duplicated types --- indexer/feature_data.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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)