Replaced std::map with flat_map for selected items in history list.

This commit is contained in:
23rd 2025-06-30 10:53:14 +03:00
parent 3a8898dd24
commit a293fa1de6
3 changed files with 4 additions and 3 deletions

View file

@ -256,7 +256,8 @@ private:
using ChosenReaction = HistoryView::Reactions::ChosenReaction;
using VideoUserpic = Dialogs::Ui::VideoUserpic;
using SelectedItems = std::map<HistoryItem*, TextSelection, std::less<>>;
using SelectedItems
= base::flat_map<HistoryItem*, TextSelection, std::less<>>;
enum class MouseAction {
None,
PrepareDrag,

View file

@ -237,7 +237,7 @@ void AddDownloadFilesAction(
void AddDownloadFilesAction(
not_null<Ui::PopupMenu*> menu,
not_null<Window::SessionController*> window,
const std::map<HistoryItem*, TextSelection, std::less<>> &items,
const base::flat_map<HistoryItem*, TextSelection, std::less<>> &items,
not_null<HistoryInner*> list) {
if (items.empty()) {
return;

View file

@ -35,7 +35,7 @@ void AddDownloadFilesAction(
not_null<Ui::PopupMenu*> menu,
not_null<Window::SessionController*> window,
// From the legacy history inner widget.
const std::map<HistoryItem*, TextSelection, std::less<>> &items,
const base::flat_map<HistoryItem*, TextSelection, std::less<>> &items,
not_null<HistoryInner*> list);
} // namespace Menu