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
@@ -288,7 +288,7 @@ void ChatsListBoxController::rebuildRows() {
auto wasEmpty = !delegate()->peerListFullRowsCount();
auto appendList = [this](auto chats) {
auto count = 0;
for (const auto row : chats->all()) {
for (const auto &row : chats->all()) {
if (const auto history = row->history()) {
if (appendRow(history)) {
++count;
@@ -389,7 +389,7 @@ void ContactsBoxController::prepare() {
void ContactsBoxController::rebuildRows() {
const auto appendList = [&](auto chats) {
auto count = 0;
for (const auto row : chats->all()) {
for (const auto &row : chats->all()) {
if (const auto history = row->history()) {
if (const auto user = history->peer->asUser()) {
if (appendRow(user)) {