From a293fa1de648d4dcd4f47eca7bd469b5bb28da0d Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 30 Jun 2025 10:53:14 +0300 Subject: [PATCH] Replaced std::map with flat_map for selected items in history list. --- Telegram/SourceFiles/history/history_inner_widget.h | 3 ++- Telegram/SourceFiles/menu/menu_item_download_files.cpp | 2 +- Telegram/SourceFiles/menu/menu_item_download_files.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_inner_widget.h b/Telegram/SourceFiles/history/history_inner_widget.h index 0da2dc7657..c3e256c3f9 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.h +++ b/Telegram/SourceFiles/history/history_inner_widget.h @@ -256,7 +256,8 @@ private: using ChosenReaction = HistoryView::Reactions::ChosenReaction; using VideoUserpic = Dialogs::Ui::VideoUserpic; - using SelectedItems = std::map>; + using SelectedItems + = base::flat_map>; enum class MouseAction { None, PrepareDrag, diff --git a/Telegram/SourceFiles/menu/menu_item_download_files.cpp b/Telegram/SourceFiles/menu/menu_item_download_files.cpp index 10423c6e07..01a990b11b 100644 --- a/Telegram/SourceFiles/menu/menu_item_download_files.cpp +++ b/Telegram/SourceFiles/menu/menu_item_download_files.cpp @@ -237,7 +237,7 @@ void AddDownloadFilesAction( void AddDownloadFilesAction( not_null menu, not_null window, - const std::map> &items, + const base::flat_map> &items, not_null list) { if (items.empty()) { return; diff --git a/Telegram/SourceFiles/menu/menu_item_download_files.h b/Telegram/SourceFiles/menu/menu_item_download_files.h index 91e270b716..896d66fe3a 100644 --- a/Telegram/SourceFiles/menu/menu_item_download_files.h +++ b/Telegram/SourceFiles/menu/menu_item_download_files.h @@ -35,7 +35,7 @@ void AddDownloadFilesAction( not_null menu, not_null window, // From the legacy history inner widget. - const std::map> &items, + const base::flat_map> &items, not_null list); } // namespace Menu