From c0a8b7956cf6c32228db9af9bc2e813c24f55cc1 Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Tue, 28 Jul 2020 18:20:43 +0300 Subject: [PATCH] [booking] crash fixes --- map/booking_availability_filter.cpp | 2 +- map/search_api.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/map/booking_availability_filter.cpp b/map/booking_availability_filter.cpp index 17b00facf3..614be78042 100644 --- a/map/booking_availability_filter.cpp +++ b/map/booking_availability_filter.cpp @@ -113,7 +113,7 @@ void FillResults(HotelsMapping && hotelsMapping, booking::HotelsWithExtras && auto info = cache.Get(hotel.GetHotelId()); if (info.m_status == Cache::HotelStatus::Available) - passedInserter(std::move(hotel.GetMappedValue()), std::move(*hotel.GetExtras())); + passedInserter(std::move(hotel.GetMappedValue()), std::move(*info.m_extras)); else if (info.m_status == Cache::HotelStatus::Unavailable) filteredOutInserter(std::move(hotel.GetMappedValue())); diff --git a/map/search_api.cpp b/map/search_api.cpp index 9a41627c04..f0344b7bdb 100644 --- a/map/search_api.cpp +++ b/map/search_api.cpp @@ -387,10 +387,11 @@ void SearchAPI::FilterAllHotelsInViewport(m2::RectD const & viewport, return base::ControlFlow::Continue; }); - ASSERT(std::is_sorted(featureIds.cbegin(), featureIds.cend()), ()); - if (featureIds.size() <= kMaxHotelFeatures) + { + sort(featureIds.begin(), featureIds.end()); m_delegate.FilterHotels(filterTasks, move(featureIds)); + } } void SearchAPI::EnableIndexingOfBookmarksDescriptions(bool enable)