From 368bc283a158c2f472a9d2a86548b9ca9dc6ec93 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 23 Jun 2022 15:34:34 +0400 Subject: [PATCH] Don't use Ui::Text::String copy construct/assign. --- .../SourceFiles/info/downloads/info_downloads_provider.cpp | 5 ++--- Telegram/SourceFiles/ui/controls/call_mute_button.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp b/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp index 58a20eff8..45c5f7599 100644 --- a/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp +++ b/Telegram/SourceFiles/info/downloads/info_downloads_provider.cpp @@ -305,9 +305,8 @@ std::vector Provider::fillSections( return {}; } - auto result = std::vector( - 1, - ListSection(Type::File, sectionDelegate())); + auto result = std::vector(); + result.emplace_back(Type::File, sectionDelegate()); auto §ion = result.back(); for (const auto &element : ranges::views::reverse(_elements)) { if (search && !element.found) { diff --git a/Telegram/SourceFiles/ui/controls/call_mute_button.cpp b/Telegram/SourceFiles/ui/controls/call_mute_button.cpp index 6017bfbcd..6b893969f 100644 --- a/Telegram/SourceFiles/ui/controls/call_mute_button.cpp +++ b/Telegram/SourceFiles/ui/controls/call_mute_button.cpp @@ -249,8 +249,8 @@ void AnimatedLabel::setText(const QString &text) { if (_text.toString() == text) { return; } - _previousText = _text; - _text.setText(_st.style, text, _options); + _previousText = std::move(_text); + _text = Ui::Text::String(_st.style, text, _options); const auto width = std::max( _st.style.font->width(_text.toString()),