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

@@ -61,7 +61,7 @@ constexpr auto kStartReorderThreshold = 30;
int FixedOnTopDialogsCount(not_null<Dialogs::IndexedList*> list) {
auto result = 0;
for (const auto row : *list) {
for (const auto &row : *list) {
if (!row->entry()->fixedOnTopIndex()) {
break;
}
@@ -74,7 +74,7 @@ int PinnedDialogsCount(
FilterId filterId,
not_null<Dialogs::IndexedList*> list) {
auto result = 0;
for (const auto row : *list) {
for (const auto &row : *list) {
if (row->entry()->fixedOnTopIndex()) {
continue;
} else if (!row->entry()->isPinnedDialog(filterId)) {
@@ -341,7 +341,7 @@ int InnerWidget::dialogsOffset() const {
int InnerWidget::fixedOnTopCount() const {
auto result = 0;
for (const auto row : *shownDialogs()) {
for (const auto &row : *shownDialogs()) {
if (row->entry()->fixedOnTopIndex()) {
++result;
} else {
@@ -1103,7 +1103,7 @@ int InnerWidget::countPinnedIndex(Row *ofRow) {
return -1;
}
auto result = 0;
for (const auto row : *shownDialogs()) {
for (const auto &row : *shownDialogs()) {
if (row->entry()->fixedOnTopIndex()) {
continue;
} else if (!row->entry()->isPinnedDialog(_filterId)) {