[core] Better check whether showing brand is redundant in subtitle

Previous implementation checked if brand was equal to name, better to check if it's located in name

Signed-off-by: eisa01 <eisa01@gmail.com>
This commit is contained in:
eisa01
2025-08-24 21:53:00 +02:00
committed by Konstantin Pastbin
parent fbc844b19e
commit 7088489814
2 changed files with 5 additions and 3 deletions

View File

@@ -250,10 +250,12 @@ void FillDetails(FeatureType & ft, std::string const & name, Result::Details & d
std::string brand{ft.GetMetadata(feature::Metadata::FMD_BRAND)};
if (!brand.empty())
{
brand = platform::GetLocalizedBrandName(brand);
if (name == brand)
brand.clear();
if (name.find(brand) != std::string::npos)
brand.clear();
}
/// @todo Avoid temporary string when OpeningHours (boost::spirit) will allow string_view.
std::string const openHours(ft.GetMetadata(feature::Metadata::FMD_OPEN_HOURS));