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
path: root/editor
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2018-09-24 14:46:34 +0300
committerAleksey Belousov <beloal@users.noreply.github.com>2018-09-25 11:56:55 +0300
commitc85aa17a61f1803f9dd8877542f4d7518a434474 (patch)
tree1827bc4bf62db6a1e8938916a4f7e20687cfc65b /editor
parenta7681b5eb9c8199ba243d3efa3aacc0077320bbe (diff)
[types_strings] review fixes
Diffstat (limited to 'editor')
-rw-r--r--editor/new_feature_categories.cpp4
-rw-r--r--editor/new_feature_categories.hpp7
2 files changed, 8 insertions, 3 deletions
diff --git a/editor/new_feature_categories.cpp b/editor/new_feature_categories.cpp
index 5c320bffe4..d0e9967857 100644
--- a/editor/new_feature_categories.cpp
+++ b/editor/new_feature_categories.cpp
@@ -46,7 +46,7 @@ void NewFeatureCategories::AddLanguage(string lang)
lang = "en";
langCode = CategoriesHolder::kEnglishCode;
}
- if (m_addedLangs.find(lang) != m_addedLangs.end())
+ if (m_addedLangs.Contains(langCode))
return;
auto const & c = classif();
@@ -55,7 +55,7 @@ void NewFeatureCategories::AddLanguage(string lang)
m_index.AddCategoryByTypeAndLang(c.GetTypeByReadableObjectName(type), langCode);
}
- m_addedLangs.insert(lang);
+ m_addedLangs.Insert(langCode);
}
NewFeatureCategories::TypeNames NewFeatureCategories::Search(string const & query) const
diff --git a/editor/new_feature_categories.hpp b/editor/new_feature_categories.hpp
index b31fcb6f29..b72bfbc3d0 100644
--- a/editor/new_feature_categories.hpp
+++ b/editor/new_feature_categories.hpp
@@ -2,9 +2,11 @@
#include "editor/editor_config.hpp"
+#include "indexer/categories_holder.hpp"
#include "indexer/categories_index.hpp"
#include "base/macros.hpp"
+#include "base/small_set.hpp"
#include "std/cstdint.hpp"
#include "std/string.hpp"
@@ -48,8 +50,11 @@ public:
TypeNames const & GetAllCreatableTypeNames() const;
private:
+ using Langs =
+ base::SmallSet<static_cast<uint64_t>(CategoriesHolder::kMaxSupportedLocaleIndex) + 1>;
+
indexer::CategoriesIndex m_index;
- unordered_set<string> m_addedLangs;
+ Langs m_addedLangs;
TypeNames m_types;
DISALLOW_COPY(NewFeatureCategories);