diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index e0453428aa..589b842a13 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -1929,7 +1929,7 @@ void ApiWrap::updateNotifySettingsDelayed(Data::DefaultNotify type) { void ApiWrap::sendNotifySettingsUpdates() { _updateNotifyQueueLifetime.destroy(); - for (const auto topic : base::take(_updateNotifyTopics)) { + for (const auto &topic : base::take(_updateNotifyTopics)) { request(MTPaccount_UpdateNotifySettings( MTP_inputNotifyForumTopic( topic->peer()->input(), @@ -1937,7 +1937,7 @@ void ApiWrap::sendNotifySettingsUpdates() { topic->notify().serialize() )).afterDelay(kSmallDelayMs).send(); } - for (const auto peer : base::take(_updateNotifyPeers)) { + for (const auto &peer : base::take(_updateNotifyPeers)) { request(MTPaccount_UpdateNotifySettings( MTP_inputNotifyPeer(peer->input()), peer->notify().serialize() @@ -3621,7 +3621,7 @@ void ApiWrap::forwardMessages( ids.reserve(count); randomIds.reserve(count); - for (const auto item : draft.items) { + for (const auto &item : draft.items) { const auto randomId = base::RandomValue(); if (genClientSideMessage) { const auto newId = FullMsgId( diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp index 52ba4c7e2d..83ef8a3528 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp @@ -585,7 +585,7 @@ void EditNoPaidMessagesExceptions( setTo.premiums = false; setTo.miniapps = false; auto &removeFrom = copy.never; - for (const auto peer : setTo.peers) { + for (const auto &peer : setTo.peers) { removeFrom.peers.erase( ranges::remove(removeFrom.peers, peer), end(removeFrom.peers)); @@ -671,7 +671,7 @@ void EditPrivacyBox::editExceptions( Unexpected("Invalid exception value."); }(); auto &removeFrom = exceptions(type); - for (const auto peer : exceptions(exception).peers) { + for (const auto &peer : exceptions(exception).peers) { removeFrom.peers.erase( ranges::remove(removeFrom.peers, peer), end(removeFrom.peers)); diff --git a/Telegram/SourceFiles/boxes/peer_list_box.h b/Telegram/SourceFiles/boxes/peer_list_box.h index 9cc91cafea..1f4405ca19 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.h +++ b/Telegram/SourceFiles/boxes/peer_list_box.h @@ -372,7 +372,7 @@ public: template void peerListAddSelectedPeers(PeerDataRange &&range) { - for (const auto peer : range) { + for (const auto &peer : range) { peerListAddSelectedPeerInBunch(peer); } peerListFinishSelectedRowsBunch(); diff --git a/Telegram/SourceFiles/boxes/peers/edit_discussion_link_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_discussion_link_box.cpp index 8f5154c955..01c838b82c 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_discussion_link_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_discussion_link_box.cpp @@ -111,7 +111,7 @@ void Controller::prepare() { if (_chat) { appendRow(_chat); } else { - for (const auto chat : _chats) { + for (const auto &chat : _chats) { appendRow(chat); } if (_chats.size() >= kEnableSearchRowsCount) { diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp index 3c2893f642..e3adb3f6df 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp @@ -614,7 +614,7 @@ void ParticipantsAdditionalData::fillFromChannel( if (information->creator) { _creator = information->creator; } - for (const auto user : information->lastParticipants) { + for (const auto &user : information->lastParticipants) { const auto admin = information->lastAdmins.find(user); const auto rank = information->memberRanks.find(peerToUser(user->id)); const auto restricted = information->lastRestricted.find(user); @@ -1575,7 +1575,7 @@ void ParticipantsBoxController::rebuildChatAdmins( delegate()->peerListRemoveRow( delegate()->peerListRowAt(0)); } - for (const auto user : list) { + for (const auto &user : list) { if (auto row = createRow(user)) { const auto raw = row.get(); delegate()->peerListAppendRow(std::move(row)); @@ -1732,7 +1732,7 @@ bool ParticipantsBoxController::feedMegagroupLastParticipants() { auto added = false; _additional.fillFromPeer(); - for (const auto user : info->lastParticipants) { + for (const auto &user : info->lastParticipants) { if (appendRow(user)) { added = true; } diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp index d1179e27eb..ac5b632317 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_invite_link.cpp @@ -1522,7 +1522,7 @@ object_ptr ShareInviteLinkBox( comment.text = link; } auto &api = session->api(); - for (const auto thread : result) { + for (const auto &thread : result) { auto message = Api::MessageToSend( Api::SendAction(thread, options)); message.textWithTags = comment; diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index 417320ba81..92d098a56c 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -1741,7 +1741,7 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback( const auto showRecentForwardsToSelf = result.size() == 1 && result.front()->peer()->isSelf() && history->session().premium(); - for (const auto thread : result) { + for (const auto &thread : result) { const auto peer = thread->peer(); const auto threadHistory = thread->owningHistory(); const auto forum = threadHistory->asForum(); @@ -2108,7 +2108,7 @@ void FastShareLink( comment.text = url; } auto &api = show->session().api(); - for (const auto thread : result) { + for (const auto &thread : result) { auto message = Api::MessageToSend( Api::SendAction(thread, options)); message.textWithTags = comment; diff --git a/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp b/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp index af11e45a23..805cc67a3b 100644 --- a/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_auction_box.cpp @@ -1823,7 +1823,7 @@ TextWithEntities ActiveAuctionsTitle(const Data::ActiveAuctions &auctions) { ).append(' ').append(tr::lng_auction_bar_active(tr::now)); } auto result = tr::marked(); - for (const auto auction : list | ranges::views::take(3)) { + for (const auto &auction : list | ranges::views::take(3)) { result.append(Data::SingleCustomEmoji(auction->gift->document)); } return result.append(' ').append( @@ -1851,7 +1851,7 @@ ManyAuctionsState ActiveAuctionsState(const Data::ActiveAuctions &auctions) { return { std::move(text), !position }; } auto outbid = 0; - for (const auto auction : list) { + for (const auto &auction : list) { if (!winning(auction)) { ++outbid; } @@ -2036,7 +2036,7 @@ Fn ActiveAuctionsCallback( .ends = state.nextRoundAt ? state.nextRoundAt : state.endDate, }; }; - for (const auto auction : list) { + for (const auto &auction : list) { state->list.push_back(singleFrom(*auction)); } return [=] { diff --git a/Telegram/SourceFiles/boxes/star_gift_box.cpp b/Telegram/SourceFiles/boxes/star_gift_box.cpp index c44f0e6074..6b404b99e1 100644 --- a/Telegram/SourceFiles/boxes/star_gift_box.cpp +++ b/Telegram/SourceFiles/boxes/star_gift_box.cpp @@ -2145,7 +2145,7 @@ Controller::Controller(not_null session, PickCallback pick) return aBirthday.day() < bBirthday.day(); }); - for (const auto user : usersWithBirthdays) { + for (const auto &user : usersWithBirthdays) { auto row = std::make_unique(user); if (auto s = status(user->birthday()); !s.isEmpty()) { row->setCustomStatus(std::move(s)); diff --git a/Telegram/SourceFiles/calls/group/calls_group_invite_controller.cpp b/Telegram/SourceFiles/calls/group/calls_group_invite_controller.cpp index 2f22d81270..537e7d3ed9 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_invite_controller.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_invite_controller.cpp @@ -344,7 +344,7 @@ void ConfInviteRow::elementsPaint( } void prepare() override { - for (const auto user : _users) { + for (const auto &user : _users) { delegate()->peerListAppendRow( std::make_unique(user, _st)); } @@ -485,7 +485,7 @@ ConfInviteController::ConfInviteController( , _shareLink(std::move(shareLink)) { if (!_shareLink) { _skip.reserve(_prioritize.size()); - for (const auto user : _prioritize) { + for (const auto &user : _prioritize) { _skip.emplace(user); } } diff --git a/Telegram/SourceFiles/calls/group/calls_group_settings.cpp b/Telegram/SourceFiles/calls/group/calls_group_settings.cpp index 6459b163b7..7f629582bf 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_settings.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_settings.cpp @@ -198,7 +198,7 @@ object_ptr ShareInviteLinkBox( comment.text = link; } auto &api = peer->session().api(); - for (const auto thread : result) { + for (const auto &thread : result) { auto message = Api::MessageToSend( Api::SendAction(thread, options)); message.textWithTags = comment; diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp index 905957f084..6e29eb20fc 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp @@ -499,7 +499,7 @@ void FieldAutocomplete::updateFiltered(bool resetScroll) { sorted.emplace(byOnline(user), user); } } - for (const auto user : _chat->lastAuthors) { + for (const auto &user : _chat->lastAuthors) { if (user->isInaccessible()) continue; if (!listAllSuggestions && filterNotPassedByName(user)) continue; if (indexOfInFirstN(mrows, user, recentInlineBots) >= 0) continue; @@ -530,7 +530,7 @@ void FieldAutocomplete::updateFiltered(bool resetScroll) { _channel); } else { mrows.reserve(mrows.size() + _channel->mgInfo->lastParticipants.size()); - for (const auto user : _channel->mgInfo->lastParticipants) { + for (const auto &user : _channel->mgInfo->lastParticipants) { if (user->isInaccessible()) continue; if (!listAllSuggestions && filterNotPassedByName(user)) continue; if (indexOfInFirstN(mrows, user, recentInlineBots) >= 0) continue; diff --git a/Telegram/SourceFiles/data/data_group_call.cpp b/Telegram/SourceFiles/data/data_group_call.cpp index 10ba213f3d..a18477b26b 100644 --- a/Telegram/SourceFiles/data/data_group_call.cpp +++ b/Telegram/SourceFiles/data/data_group_call.cpp @@ -976,7 +976,7 @@ void GroupCall::checkFinishSpeakingByActive() { ++i; } } - for (const auto participantPeer : stop) { + for (const auto &participantPeer : stop) { const auto participant = findParticipant(participantPeer); Assert(participant != nullptr); if (participant->speaking) { diff --git a/Telegram/SourceFiles/data/data_histories.cpp b/Telegram/SourceFiles/data/data_histories.cpp index 59b0b558bc..335333c781 100644 --- a/Telegram/SourceFiles/data/data_histories.cpp +++ b/Telegram/SourceFiles/data/data_histories.cpp @@ -984,7 +984,7 @@ void Histories::deleteMessages(const MessageIdsList &ids, bool revoke) { document->owner().savedMusic().remove(document); } - for (const auto item : remove) { + for (const auto &item : remove) { const auto history = item->history(); const auto wasLast = (history->lastMessage() == item); const auto wasInChats = (history->chatListMessage() == item); diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 5c43ae35f9..963fc89abb 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -1709,7 +1709,7 @@ void Session::enumerateItemViews( not_null item, Method method) { if (const auto i = _views.find(item); i != _views.end()) { - for (const auto view : i->second) { + for (const auto &view : i->second) { method(view); } } @@ -2297,7 +2297,7 @@ void Session::unloadHeavyViewParts( remove.push_back(view); } } - for (const auto view : remove) { + for (const auto &view : remove) { view->unloadHeavyPart(); } } @@ -2317,7 +2317,7 @@ void Session::unloadHeavyViewParts( remove.push_back(view); } } - for (const auto view : remove) { + for (const auto &view : remove) { view->unloadHeavyPart(); } } @@ -4679,7 +4679,7 @@ void Session::registerContactItem( } if (const auto i = _views.find(item); i != _views.end()) { - for (const auto view : i->second) { + for (const auto &view : i->second) { if (const auto media = view->media()) { media->updateSharedContactUserId(contactId); } @@ -4746,7 +4746,7 @@ void Session::unregisterStoryItem( void Session::refreshStoryItemViews(FullStoryId id) { const auto i = _storyItems.find(id); if (i != _storyItems.end()) { - for (const auto item : i->second) { + for (const auto &item : i->second) { if (const auto media = item->media()) { if (media->storyMention()) { item->updateStoryMentionText(); diff --git a/Telegram/SourceFiles/data/stickers/data_stickers.cpp b/Telegram/SourceFiles/data/stickers/data_stickers.cpp index 5d47f2a987..19a464be50 100644 --- a/Telegram/SourceFiles/data/stickers/data_stickers.cpp +++ b/Telegram/SourceFiles/data/stickers/data_stickers.cpp @@ -261,7 +261,7 @@ void Stickers::incrementSticker(not_null document) { set->emoji[emoji].push_front(document); } } else if (!removedFromEmoji.empty()) { - for (const auto emoji : removedFromEmoji) { + for (const auto &emoji : removedFromEmoji) { set->emoji[emoji].push_front(document); } } else { @@ -1465,7 +1465,7 @@ std::vector> Stickers::getListByEmoji( const auto others = session().api().stickersByEmoji(key); if (others) { result.reserve(result.size() + others->size()); - for (const auto document : *others) { + for (const auto &document : *others) { add(document, CreateOtherSortKey(document)); } } else if (!forceAllResults) { diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 765aaf2f14..447a16a8f1 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -638,7 +638,7 @@ void History::destroyMessagesByDates(TimeId minDate, TimeId maxDate) { toDestroy.push_back(message.get()); } } - for (const auto item : toDestroy) { + for (const auto &item : toDestroy) { item->destroy(); } } @@ -651,7 +651,7 @@ void History::destroyMessagesByTopic(MsgId topicRootId) { toDestroy.push_back(message.get()); } } - for (const auto item : toDestroy) { + for (const auto &item : toDestroy) { item->destroy(); } } @@ -665,7 +665,7 @@ void History::destroyMessagesBySublist(not_null sublistPeer) { toDestroy.push_back(message.get()); } } - for (const auto item : toDestroy) { + for (const auto &item : toDestroy) { item->destroy(); } } @@ -4043,7 +4043,7 @@ void History::clearUpTill(MsgId availableMinId) { remove.push_back(item.get()); } } - for (const auto item : remove) { + for (const auto &item : remove) { item->destroy(); } requestChatListMessage(); diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 74086f72ff..5512716a54 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -5214,7 +5214,7 @@ void HistoryInner::applyDragSelection( toRemove.emplace_back(item.first); } } - for (const auto item : toRemove) { + for (const auto &item : toRemove) { changeSelectionAsGroup(toItems, item, SelectAction::Deselect); } } diff --git a/Telegram/SourceFiles/history/history_item_helpers.cpp b/Telegram/SourceFiles/history/history_item_helpers.cpp index 7f67eba947..a696d85178 100644 --- a/Telegram/SourceFiles/history/history_item_helpers.cpp +++ b/Telegram/SourceFiles/history/history_item_helpers.cpp @@ -179,7 +179,7 @@ Data::SendError GetErrorForSending( Data::SendErrorWithThread GetErrorForSending( const std::vector> &threads, SendingErrorRequest request) { - for (const auto thread : threads) { + for (const auto &thread : threads) { const auto error = GetErrorForSending(thread, request); if (error) { return Data::SendErrorWithThread{ error, thread }; diff --git a/Telegram/SourceFiles/history/view/controls/history_view_forward_panel.cpp b/Telegram/SourceFiles/history/view/controls/history_view_forward_panel.cpp index 8dcbfe0423..063c39a38b 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_forward_panel.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_forward_panel.cpp @@ -105,7 +105,7 @@ void ForwardPanel::checkTexts() { ? kNameWithCaptionsVersion : kNameNoCaptionsVersion; if (keepNames) { - for (const auto item : _data.items) { + for (const auto &item : _data.items) { if (const auto from = item->originalSender()) { version += from->nameVersion(); } else if (item->originalHiddenSenderInfo()) { @@ -142,7 +142,7 @@ void ForwardPanel::updateTexts() { auto fullname = QString(); auto names = std::vector(); names.reserve(_data.items.size()); - for (const auto item : _data.items) { + for (const auto &item : _data.items) { if (const auto from = item->originalSender()) { if (!insertedPeers.contains(from)) { insertedPeers.emplace(from); diff --git a/Telegram/SourceFiles/history/view/history_view_about_view.cpp b/Telegram/SourceFiles/history/view/history_view_about_view.cpp index 0424dd26de..544be0cace 100644 --- a/Telegram/SourceFiles/history/view/history_view_about_view.cpp +++ b/Telegram/SourceFiles/history/view/history_view_about_view.cpp @@ -201,7 +201,7 @@ void UserpicsList::subscribeToUpdates(Fn callback) { return; } _subscribed = std::make_unique(std::move(callback)); - for (const auto peer : _peers) { + for (const auto &peer : _peers) { _subscribed->list.push_back({ .peer = peer }); } } diff --git a/Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.cpp b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.cpp index 870d18e687..c48b0ed6cd 100644 --- a/Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.cpp +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions_list.cpp @@ -261,7 +261,7 @@ void Controller::showReaction(const ReactionId &reaction) { }) | ranges::views::transform( &AllEntry::first ) | ranges::to_vector; - for (const auto peer : _filtered) { + for (const auto &peer : _filtered) { appendRow(peer, _shownReaction); } _filteredOffset = QString(); diff --git a/Telegram/SourceFiles/info/info_wrap_widget.cpp b/Telegram/SourceFiles/info/info_wrap_widget.cpp index 4cc5413e7c..38c20538a4 100644 --- a/Telegram/SourceFiles/info/info_wrap_widget.cpp +++ b/Telegram/SourceFiles/info/info_wrap_widget.cpp @@ -836,7 +836,7 @@ void WrapWidget::showFinishedHook() { showTopBarMenu(false); if (_topBarMenu) { const auto menu = _topBarMenu->menu(); - for (const auto action : menu->actions()) { + for (const auto &action : menu->actions()) { const auto controlId = "highlight-control-id"; if (action->property(controlId).toString() == highlightId) { if (const auto item = menu->itemForAction(action)) { diff --git a/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp b/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp index 39eba79817..f67b18f090 100644 --- a/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp +++ b/Telegram/SourceFiles/info/similar_peers/info_similar_peers_widget.cpp @@ -128,7 +128,7 @@ rpl::producer ListController::unlockHeightValue() const { void ListController::rebuild() { const auto participants = &_peer->session().api().chatParticipants(); const auto &list = participants->similar(_peer); - for (const auto peer : list.list) { + for (const auto &peer : list.list) { if (!delegate()->peerListFindRow(peer->id.value)) { delegate()->peerListAppendRow(createRow(peer)); } diff --git a/Telegram/SourceFiles/media/stories/media_stories_share.cpp b/Telegram/SourceFiles/media/stories/media_stories_share.cpp index 6fb899ff94..8538759fec 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_share.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_share.cpp @@ -120,7 +120,7 @@ namespace Media::Stories { comment.text = url; } auto &api = show->session().api(); - for (const auto thread : result) { + for (const auto &thread : result) { auto message = Api::MessageToSend( Api::SendAction(thread, options)); message.textWithTags = comment; @@ -134,7 +134,7 @@ namespace Media::Stories { const auto api = &story->session().api(); auto &histories = story->owner().histories(); - for (const auto thread : result) { + for (const auto &thread : result) { const auto action = Api::SendAction(thread, options); if (!comment.text.isEmpty()) { auto message = Api::MessageToSend(action); diff --git a/Telegram/SourceFiles/settings/sections/settings_main.cpp b/Telegram/SourceFiles/settings/sections/settings_main.cpp index 61a6e115dc..c8dc269642 100644 --- a/Telegram/SourceFiles/settings/sections/settings_main.cpp +++ b/Telegram/SourceFiles/settings/sections/settings_main.cpp @@ -721,7 +721,7 @@ void Main::showFinished() { if (controller()->takeHighlightControlId(emojiId)) { if (const auto popupMenu = _userpic->showChangePhotoMenu()) { const auto menu = popupMenu->menu(); - for (const auto action : menu->actions()) { + for (const auto &action : menu->actions()) { const auto controlId = "highlight-control-id"; if (action->property(controlId).toString() == emojiId) { if (const auto item = menu->itemForAction(action)) { diff --git a/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp b/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp index 3cf9b425cd..1cb6d28242 100644 --- a/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/emoji_stake_box.cpp @@ -402,7 +402,7 @@ void AddStakePresets( const auto cols = int(row.size()); const auto singlew = (width - (cols - 1) * xskip) / cols; auto x = 0; - for (const auto button : row) { + for (const auto &button : row) { button->setFullWidth(singlew); button->move(x, y); x += singlew + xskip; diff --git a/Telegram/SourceFiles/window/window_chat_switch_process.cpp b/Telegram/SourceFiles/window/window_chat_switch_process.cpp index 230038c6f3..1ae251a08c 100644 --- a/Telegram/SourceFiles/window/window_chat_switch_process.cpp +++ b/Telegram/SourceFiles/window/window_chat_switch_process.cpp @@ -62,7 +62,7 @@ void CloseInWindows(not_null thread) { using WindowPointer = base::weak_ptr; auto closing = std::vector(); auto clearing = std::vector(); - for (const auto window : thread->session().windows()) { + for (const auto &window : thread->session().windows()) { if (window->windowId().chat() == thread) { closing.push_back(base::make_weak(window)); } else if (window->activeChatCurrent().thread() == thread) { diff --git a/Telegram/SourceFiles/window/window_media_preview.cpp b/Telegram/SourceFiles/window/window_media_preview.cpp index 7befad08c7..e249310597 100644 --- a/Telegram/SourceFiles/window/window_media_preview.cpp +++ b/Telegram/SourceFiles/window/window_media_preview.cpp @@ -153,7 +153,7 @@ void MediaPreviewWidget::paintEvent(QPaintEvent *e) { + (emojiCount - 1) * st::stickerEmojiSkip; auto emojiLeft = (width() - emojiWidth) / 2; const auto esize = Ui::Emoji::GetSizeLarge(); - for (const auto emoji : _emojiList) { + for (const auto &emoji : _emojiList) { Ui::Emoji::Draw( p, emoji, diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index c82a775150..e0eb08759b 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -3201,7 +3201,7 @@ base::weak_qptr ShowForwardMessagesBox( const auto sendMenuType = [=] { const auto selected = state->box->collectSelectedRows(); const auto hasPaid = [&] { - for (const auto peer : selected) { + for (const auto &peer : selected) { if (peer->starsPerMessageChecked()) { return true; }