From 320f9712a3383f6357f400c4afb0854310c7cfc6 Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Fri, 14 Jan 2022 00:54:39 +0300 Subject: [PATCH] Minor FeatureType api fixes. Signed-off-by: Viktor Govako --- indexer/feature.cpp | 6 +++--- indexer/feature.hpp | 5 ++--- search/search_quality/matcher.cpp | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/indexer/feature.cpp b/indexer/feature.cpp index 04a7cda5dc..bc2c1c0839 100644 --- a/indexer/feature.cpp +++ b/indexer/feature.cpp @@ -771,7 +771,7 @@ void FeatureType::GetReadableName(bool allowTranslit, int8_t deviceLang, string ::GetReadableName(mwmInfo->GetRegionData(), GetNames(), deviceLang, allowTranslit, name); } -string FeatureType::GetHouseNumber() +string const & FeatureType::GetHouseNumber() { ParseCommon(); return m_params.house.Get(); @@ -794,7 +794,7 @@ uint8_t FeatureType::GetRank() uint64_t FeatureType::GetPopulation() { return feature::RankToPopulation(GetRank()); } -string FeatureType::GetRoadNumber() +string const & FeatureType::GetRoadNumber() { ParseCommon(); return m_params.ref; @@ -816,7 +816,7 @@ std::string FeatureType::GetMetadata(feature::Metadata::EType type) if (it == m_metaIds.end()) return {}; - auto const value = m_metadataDeserializer->GetMetaById(it->second); + auto value = m_metadataDeserializer->GetMetaById(it->second); m_metadata.Set(type, value); return value; } diff --git a/indexer/feature.hpp b/indexer/feature.hpp index 2c1844cf2d..b3672ec992 100644 --- a/indexer/feature.hpp +++ b/indexer/feature.hpp @@ -38,7 +38,6 @@ public: FeatureType(osm::MapObject const & emo); feature::GeomType GetGeomType() const; - FeatureParamsBase & GetParams() { return m_params; } uint8_t GetTypesCount() const { return (m_header & feature::HEADER_MASK_TYPE) + 1; } @@ -134,7 +133,7 @@ public: std::string DebugString(int scale); - std::string GetHouseNumber(); + std::string const & GetHouseNumber(); /// @name Get names for feature. /// @param[out] defaultName corresponds to osm tag "name" @@ -153,7 +152,7 @@ public: uint8_t GetRank(); uint64_t GetPopulation(); - std::string GetRoadNumber(); + std::string const & GetRoadNumber(); feature::Metadata const & GetMetadata(); diff --git a/search/search_quality/matcher.cpp b/search/search_quality/matcher.cpp index 11245cc34b..784dbd90f0 100644 --- a/search/search_quality/matcher.cpp +++ b/search/search_quality/matcher.cpp @@ -208,7 +208,7 @@ bool Matcher::Matches(strings::UniString const & query, Sample::Result const & g { if (ft.GetGeomType() == feature::GeomType::Line) { - nameMatches = StreetMatches(ft.GetParams().ref, queryTokens); + nameMatches = StreetMatches(ft.GetRoadNumber(), queryTokens); } else {