2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Appended references to const auto types in loop to prevent copying.

Suggested by Apple Clang.
This commit is contained in:
23rd
2021-09-08 13:53:54 +03:00
committed by John Preston
parent baea762832
commit 900a7d0b2b
67 changed files with 153 additions and 153 deletions

View File

@@ -560,7 +560,7 @@ ShareBox::Inner::Inner(QWidget *parent, const Descriptor &descriptor)
_chatsIndexed->addToEnd(self->owner().history(self));
}
const auto addList = [&](not_null<Dialogs::IndexedList*> list) {
for (const auto row : list->all()) {
for (const auto &row : list->all()) {
if (const auto history = row->history()) {
if (!history->peer->isSelf()
&& _descriptor.filterCallback(history->peer)) {
@@ -703,7 +703,7 @@ void ShareBox::Inner::repaintChat(not_null<PeerData*> peer) {
int ShareBox::Inner::chatIndex(not_null<PeerData*> peer) const {
int index = 0;
if (_filter.isEmpty()) {
for (const auto row : _chatsIndexed->all()) {
for (const auto &row : _chatsIndexed->all()) {
if (const auto history = row->history()) {
if (history->peer == peer) {
return index;
@@ -712,7 +712,7 @@ int ShareBox::Inner::chatIndex(not_null<PeerData*> peer) const {
++index;
}
} else {
for (const auto row : _filtered) {
for (const auto &row : _filtered) {
if (const auto history = row->history()) {
if (history->peer == peer) {
return index;