diff --git a/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp b/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp index 5757d7b89e..4d9f888d25 100644 --- a/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp +++ b/Telegram/SourceFiles/history/view/history_view_subsection_tabs.cpp @@ -341,11 +341,15 @@ void SubsectionTabs::setupSlider( scrollSavingIndex = -1; for (auto index = 0; index != count; ++index) { const auto thread = _sectionsSlice[index].thread; - if (ranges::contains(_slice, thread, &Item::thread)) { + const auto i = ranges::find( + _slice, + thread, + &Item::thread); + if (i != end(_slice)) { scrollSavingThread = thread; scrollSavingShift = scrollValue - slider->lookupSectionPosition(index); - scrollSavingIndex = index; + scrollSavingIndex = int(i - begin(_slice)); break; } }