diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp index bc14c8bb46..f36fe63f5b 100644 --- a/indexer/feature_utils.cpp +++ b/indexer/feature_utils.cpp @@ -456,18 +456,25 @@ string GetLocalizedFeeType(TypesHolder const & types) string GetReadableWheelchairType(TypesHolder const & types) { - auto const & isWheelchairType = ftypes::IsWheelchairTypeChecker::Instance(); - auto readableTypes = GetReadableTypes(isWheelchairType, types); - ASSERT_LESS_OR_EQUAL ( readableTypes.size(), 1, () ); - if (readableTypes.empty()) - return ""; - return readableTypes[0]; + auto const value = ftraits::Wheelchair::GetValue(types); + if (!value.has_value()) + return ""; + + switch (*value) + { + case ftraits::WheelchairAvailability::No: + return "wheelchair-no"; + case ftraits::WheelchairAvailability::Yes: + return "wheelchair-yes"; + case ftraits::WheelchairAvailability::Limited: + return "wheelchair-limited"; + } + UNREACHABLE(); } -ftraits::WheelchairAvailability GetWheelchairType(TypesHolder const & types) +std::optional GetWheelchairType(TypesHolder const & types) { - auto const opt = ftraits::Wheelchair::GetValue(types); - return opt ? *opt : ftraits::WheelchairAvailability::Unknown; + return ftraits::Wheelchair::GetValue(types); } bool HasAtm(TypesHolder const & types) diff --git a/indexer/feature_utils.hpp b/indexer/feature_utils.hpp index 03713a9826..dda9128f9c 100644 --- a/indexer/feature_utils.hpp +++ b/indexer/feature_utils.hpp @@ -155,7 +155,7 @@ namespace feature std::string GetReadableWheelchairType(TypesHolder const & types); /// @returns wheelchair availability. - ftraits::WheelchairAvailability GetWheelchairType(TypesHolder const & types); + std::optional GetWheelchairType(TypesHolder const & types); /// Returns true if feature has ATM type. bool HasAtm(TypesHolder const & types); diff --git a/indexer/ftraits.hpp b/indexer/ftraits.hpp index 3f0057d614..1ca90a416c 100644 --- a/indexer/ftraits.hpp +++ b/indexer/ftraits.hpp @@ -74,7 +74,6 @@ enum class WheelchairAvailability No, Yes, Limited, - Unknown }; inline std::string DebugPrint(WheelchairAvailability wheelchair) @@ -84,7 +83,6 @@ inline std::string DebugPrint(WheelchairAvailability wheelchair) case WheelchairAvailability::No: return "No"; case WheelchairAvailability::Yes: return "Yes"; case WheelchairAvailability::Limited: return "Limited"; - case WheelchairAvailability::Unknown: return "Unknown"; } UNREACHABLE(); } @@ -99,8 +97,7 @@ class Wheelchair : public TraitsBase { m_matcher.Append({{"wheelchair", "no"}}, WheelchairAvailability::No); m_matcher.Append({{"wheelchair", "yes"}}, WheelchairAvailability::Yes); - m_matcher.Append({{"wheelchair", "limited"}}, - WheelchairAvailability::Limited); + m_matcher.Append({{"wheelchair", "limited"}}, WheelchairAvailability::Limited); } }; diff --git a/indexer/ftypes_matcher.cpp b/indexer/ftypes_matcher.cpp index d6c6faf424..d54d746f2e 100644 --- a/indexer/ftypes_matcher.cpp +++ b/indexer/ftypes_matcher.cpp @@ -765,12 +765,6 @@ IsFeeTypeChecker::IsFeeTypeChecker() : BaseChecker(1 /* level */) m_types.push_back(c.GetTypeByPath({"fee"})); } -IsWheelchairTypeChecker::IsWheelchairTypeChecker() : BaseChecker(1 /* level */) -{ - Classificator const & c = classif(); - m_types.push_back(c.GetTypeByPath({"wheelchair"})); -} - IsToiletsChecker::IsToiletsChecker() : BaseChecker(2 /* level */) { Classificator const & c = classif(); diff --git a/indexer/ftypes_matcher.hpp b/indexer/ftypes_matcher.hpp index 70ffc3efe4..3792a1dffb 100644 --- a/indexer/ftypes_matcher.hpp +++ b/indexer/ftypes_matcher.hpp @@ -476,14 +476,6 @@ public: DECLARE_CHECKER_INSTANCE(IsFeeTypeChecker); }; -class IsWheelchairTypeChecker : public BaseChecker -{ - IsWheelchairTypeChecker(); - -public: - DECLARE_CHECKER_INSTANCE(IsWheelchairTypeChecker); -}; - class IsToiletsChecker : public BaseChecker { IsToiletsChecker();