mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/telegramdesktop/tdesktop
synced 2026-09-21 08:33:45 +08:00
Appended references to const auto types in loop to prevent copying.
Suggested by Apple Clang.
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user