diff --git a/android/src/com/mapswithme/util/Utils.java b/android/src/com/mapswithme/util/Utils.java index afd9a201a0..1ac8245023 100644 --- a/android/src/com/mapswithme/util/Utils.java +++ b/android/src/com/mapswithme/util/Utils.java @@ -1,7 +1,6 @@ package com.mapswithme.util; import android.app.Activity; -import android.app.Application; import android.content.ActivityNotFoundException; import android.content.ClipData; import android.content.Context; @@ -738,7 +737,7 @@ public class Utils // Called from JNI. @NonNull @SuppressWarnings("unused") - public static String getLocalizedFeatureType(String type) + public static String getLocalizedFeatureType(@NonNull String type) { return getLocalizedFeatureType(MwmApplication.get(), type); } diff --git a/editor/editor_tests/new_feature_categories_test.cpp b/editor/editor_tests/new_feature_categories_test.cpp index e629cc6350..ddc86a5e57 100644 --- a/editor/editor_tests/new_feature_categories_test.cpp +++ b/editor/editor_tests/new_feature_categories_test.cpp @@ -32,7 +32,7 @@ UNIT_TEST(NewFeatureCategories_UniqueNames) continue; categories.AddLanguage(lang); auto names = categories.GetAllCreatableTypeNames(); - + std::sort(names.begin(), names.end()); auto result = std::unique(names.begin(), names.end()); if (result != names.end()) diff --git a/editor/new_feature_categories.hpp b/editor/new_feature_categories.hpp index b72bfbc3d0..fb2110c89d 100644 --- a/editor/new_feature_categories.hpp +++ b/editor/new_feature_categories.hpp @@ -10,7 +10,6 @@ #include "std/cstdint.hpp" #include "std/string.hpp" -#include "std/unordered_set.hpp" #include "std/vector.hpp" namespace osm diff --git a/iphone/Maps/UI/Editor/MWMObjectsCategorySelectorDataSource.mm b/iphone/Maps/UI/Editor/MWMObjectsCategorySelectorDataSource.mm index 2360e45dfd..75f447dfa2 100644 --- a/iphone/Maps/UI/Editor/MWMObjectsCategorySelectorDataSource.mm +++ b/iphone/Maps/UI/Editor/MWMObjectsCategorySelectorDataSource.mm @@ -27,14 +27,6 @@ std::string locale() { return locale_translator::bcp47ToTwineLanguage(NSLocale.currentLocale.localeIdentifier); } - -void SortByTranslation(Categories & result) -{ - std::sort(result.begin(), result.end(), [](Category const & lhs, Category const & rhs) - { - return lhs.first < rhs.first; - }); -} } // namespace @interface MWMObjectsCategorySelectorDataSource() @@ -67,7 +59,7 @@ void SortByTranslation(Categories & result) for (auto const & type : types) m_allCategories.emplace_back(platform::GetLocalizedTypeName(type), type); - SortByTranslation(m_allCategories); + std::sort(m_allCategories.begin(), m_allCategories.end()); } - (void)search:(NSString *)query @@ -83,7 +75,7 @@ void SortByTranslation(Categories & result) for (auto const & type : types) m_filteredCategories.emplace_back(platform::GetLocalizedTypeName(type), type); - SortByTranslation(m_filteredCategories); + std::sort(m_filteredCategories.begin(), m_filteredCategories.end()); } - (NSString *)getTranslation:(NSInteger)row diff --git a/platform/localization.mm b/platform/localization.mm index c397ac1dbe..c511228a66 100644 --- a/platform/localization.mm +++ b/platform/localization.mm @@ -3,6 +3,7 @@ #include #import + namespace platform { std::string GetLocalizedTypeName(std::string const & type) diff --git a/search/result.cpp b/search/result.cpp index 110ac9d381..0e1064285d 100644 --- a/search/result.cpp +++ b/search/result.cpp @@ -87,6 +87,7 @@ FeatureID const & Result::GetFeatureID() const uint32_t Result::GetFeatureType() const { + ASSERT(m_resultType == Type::Feature, (m_resultType)); return m_featureType; } diff --git a/search/search_quality/assessment_tool/result_view.cpp b/search/search_quality/assessment_tool/result_view.cpp index 6e1248d082..dd330f64d4 100644 --- a/search/search_quality/assessment_tool/result_view.cpp +++ b/search/search_quality/assessment_tool/result_view.cpp @@ -44,9 +44,8 @@ string GetResultType(search::Sample::Result const & result) string GetResultType(search::Result const & result) { - string readableType; if (result.GetResultType() == search::Result::Type::Feature) - return readableType = classif().GetReadableObjectName(result.GetFeatureType()); + return classif().GetReadableObjectName(result.GetFeatureType()); return ""; }