From 69953c2b12d6f759cc3492dade2aa4200878091b Mon Sep 17 00:00:00 2001 From: Kiryl Kaveryn Date: Tue, 21 Jan 2025 20:15:01 +0400 Subject: [PATCH] [ios] remove unused search::ProductInfo from the search Signed-off-by: Kiryl Kaveryn --- iphone/Maps/Core/Search/MWMSearch.h | 2 -- iphone/Maps/Core/Search/MWMSearch.mm | 6 ------ iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.h | 4 +--- iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm | 4 +--- .../UI/Search/TableView/MWMSearchTableViewController.mm | 3 +-- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/iphone/Maps/Core/Search/MWMSearch.h b/iphone/Maps/Core/Search/MWMSearch.h index edc489da2a..3e09f1085b 100644 --- a/iphone/Maps/Core/Search/MWMSearch.h +++ b/iphone/Maps/Core/Search/MWMSearch.h @@ -5,7 +5,6 @@ namespace search { class Result; -struct ProductInfo; } // namespace search @interface MWMSearch : NSObject @@ -21,7 +20,6 @@ struct ProductInfo; + (MWMSearchItemType)resultTypeWithRow:(NSUInteger)row; + (NSUInteger)containerIndexWithRow:(NSUInteger)row; + (search::Result const &)resultWithContainerIndex:(NSUInteger)index; -+ (search::ProductInfo const &)productInfoWithContainerIndex:(NSUInteger)index; + (void)clear; diff --git a/iphone/Maps/Core/Search/MWMSearch.mm b/iphone/Maps/Core/Search/MWMSearch.mm index d5b13d5316..d56b26c65b 100644 --- a/iphone/Maps/Core/Search/MWMSearch.mm +++ b/iphone/Maps/Core/Search/MWMSearch.mm @@ -35,7 +35,6 @@ using Observers = NSHashTable; bool m_isCategory; search::Results m_everywhereResults; search::Results m_viewportResults; - std::vector m_productInfo; } #pragma mark - Instance @@ -74,7 +73,6 @@ using Observers = NSHashTable; { self.suggestionsCount = results.GetSuggestsCount(); self->m_everywhereResults = std::move(results); - self->m_productInfo = std::move(productInfo); [self onSearchResultsUpdated]; } @@ -170,10 +168,6 @@ using Observers = NSHashTable; return [MWMSearch manager]->m_everywhereResults[index]; } -+ (search::ProductInfo const &)productInfoWithContainerIndex:(NSUInteger)index { - return [MWMSearch manager]->m_productInfo[index]; -} - + (MWMSearchItemType)resultTypeWithRow:(NSUInteger)row { auto itemsIndex = [MWMSearch manager].itemsIndex; return [itemsIndex resultTypeWithRow:row]; diff --git a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.h b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.h index 41e2e4b07f..19f1e2abe0 100644 --- a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.h +++ b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.h @@ -6,8 +6,6 @@ @interface MWMSearchCommonCell : MWMSearchCell -- (void)config:(search::Result const &)result - productInfo:(search::ProductInfo const &)productInfo - localizedTypeName:(NSString *)localizedTypeName; +- (void)config:(search::Result const &)result localizedTypeName:(NSString *)localizedTypeName; @end diff --git a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm index bd59169fa8..1375244bc4 100644 --- a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm +++ b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm @@ -23,9 +23,7 @@ @implementation MWMSearchCommonCell -- (void)config:(search::Result const &)result - productInfo:(search::ProductInfo const &)productInfo - localizedTypeName:(NSString *)localizedTypeName +- (void)config:(search::Result const &)result localizedTypeName:(NSString *)localizedTypeName { [super config:result localizedTypeName:localizedTypeName]; diff --git a/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm b/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm index b8ec74203f..36ef7c3d08 100644 --- a/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm +++ b/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm @@ -89,8 +89,7 @@ NSString *GetLocalizedTypeName(search::Result const &result) { { auto cell = static_cast( [tableView dequeueReusableCellWithCellClass:[MWMSearchCommonCell class] indexPath:indexPath]); - auto const & productInfo = [MWMSearch productInfoWithContainerIndex:containerIndex]; - [cell config:result productInfo:productInfo localizedTypeName:GetLocalizedTypeName(result)]; + [cell config:result localizedTypeName:GetLocalizedTypeName(result)]; return cell; } case MWMSearchItemTypeSuggestion: