From 2ee305659b3588a4d0dc45a16a05e93225808a70 Mon Sep 17 00:00:00 2001 From: eisa01 Date: Thu, 28 Aug 2025 15:10:15 +0200 Subject: [PATCH] Clean up code Signed-off-by: eisa01 --- .../CoreApi/PlacePageData/Common/PlacePagePreviewData.mm | 1 - libs/search/highlighting.cpp | 4 ++-- libs/search/result.cpp | 5 ----- libs/search/result.hpp | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.mm b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.mm index a82bd59e0..acff8d486 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePagePreviewData.mm @@ -59,7 +59,6 @@ static PlacePageDataSchedule convertOpeningHours(std::string_view rawOH) return self; } - @end @implementation PlacePagePreviewData (Core) diff --git a/libs/search/highlighting.cpp b/libs/search/highlighting.cpp index 9f2b8d316..e8a3a85d7 100644 --- a/libs/search/highlighting.cpp +++ b/libs/search/highlighting.cpp @@ -51,9 +51,9 @@ void HighlightResult(QueryTokens const & tokens, strings::UniString const & pref std::string titleForHighlighting = res.GetString(); std::string const & branch = res.GetBranch(); - // If we have a branch, create combined string for highlighting + // If we have a branch that is not already in the title, create combined string for highlighting // This matches the iOS UI behavior where branch is appended as " branchText" - if (!branch.empty()) + if (!branch.empty() && titleForHighlighting.find(branch) == std::string::npos) { titleForHighlighting += " " + branch; } diff --git a/libs/search/result.cpp b/libs/search/result.cpp index 38ca38274..92d4257d4 100644 --- a/libs/search/result.cpp +++ b/libs/search/result.cpp @@ -134,11 +134,6 @@ string const & Result::GetSuggestionString() const return m_suggestionStr; } -string Result::GetBranch() const -{ - return m_branch; -} - bool Result::IsEqualSuggest(Result const & r) const { return m_suggestionStr == r.m_suggestionStr; diff --git a/libs/search/result.hpp b/libs/search/result.hpp index b639310fe..59d091fa8 100644 --- a/libs/search/result.hpp +++ b/libs/search/result.hpp @@ -76,7 +76,7 @@ public: std::string const & GetString() const { return m_str; } std::string const & GetAddress() const { return m_address; } std::string const & GetDescription() const { return m_details.m_description; } - std::string GetBranch() const; + std::string const & GetBranch() const { return m_branch; } osm::YesNoUnknown IsOpenNow() const { return m_details.m_isOpenNow; } uint16_t GetMinutesUntilOpen() const { return m_details.m_minutesUntilOpen; }