mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/telegramdesktop/tdesktop
synced 2026-09-20 08:03:45 +08:00
Use brace-init instead of make_pair.
This commit is contained in:
@@ -1841,7 +1841,7 @@ RecentStickerPack &Stickers::getRecentPack() const {
|
||||
const auto document = owner().document(preloaded.first);
|
||||
if (!document || !document->sticker()) continue;
|
||||
|
||||
recent.push_back(std::make_pair(document, preloaded.second));
|
||||
recent.push_back({ document, preloaded.second });
|
||||
}
|
||||
}
|
||||
return cRefRecentStickers();
|
||||
|
||||
@@ -278,7 +278,7 @@ void _logsWrite(LogDataType type, const QString &msg) {
|
||||
if (!LogsInMemory) {
|
||||
LogsInMemory = new LogsInMemoryList;
|
||||
}
|
||||
LogsInMemory->push_back(std::make_pair(type, msg));
|
||||
LogsInMemory->push_back({ type, msg });
|
||||
} else if (!LogsBeforeSingleInstanceChecked.isEmpty() && type == LogDataMain) {
|
||||
LogsBeforeSingleInstanceChecked += msg;
|
||||
}
|
||||
|
||||
@@ -1005,7 +1005,7 @@ bool ReadSetting(
|
||||
}
|
||||
auto id = Ui::Emoji::IdFromOldKey(oldKey);
|
||||
if (!id.isEmpty()) {
|
||||
p.push_back(std::make_pair(id, item.second));
|
||||
p.push_back({ id, item.second });
|
||||
}
|
||||
}
|
||||
Core::App().settings().setLegacyRecentEmojiPreload(std::move(p));
|
||||
@@ -1024,7 +1024,7 @@ bool ReadSetting(
|
||||
for (auto &item : v) {
|
||||
auto id = Ui::Emoji::IdFromOldKey(item.first);
|
||||
if (!id.isEmpty()) {
|
||||
p.push_back(std::make_pair(id, item.second));
|
||||
p.push_back({ id, item.second });
|
||||
}
|
||||
}
|
||||
Core::App().settings().setLegacyRecentEmojiPreload(std::move(p));
|
||||
|
||||
@@ -1417,7 +1417,7 @@ void incrementRecentHashtag(RecentHashtagPack &recent, const QString &tag) {
|
||||
}
|
||||
if (i == e) {
|
||||
while (recent.size() >= 64) recent.pop_back();
|
||||
recent.push_back(std::make_pair(tag, 1));
|
||||
recent.push_back({ tag, 1 });
|
||||
for (i = recent.end() - 1; i != recent.begin(); --i) {
|
||||
if ((i - 1)->second > i->second) {
|
||||
break;
|
||||
|
||||
@@ -1038,8 +1038,7 @@ void Account::writeSessionSettings(Main::SessionSettings *stored) {
|
||||
const auto &stickers = _owner->session().data().stickers();
|
||||
recentStickers.reserve(stickers.getRecentPack().size());
|
||||
for (const auto &pair : std::as_const(stickers.getRecentPack())) {
|
||||
recentStickers.push_back(
|
||||
std::make_pair(pair.first->id, pair.second));
|
||||
recentStickers.push_back({ pair.first->id, pair.second });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2570,7 +2569,7 @@ void Account::importOldRecentStickers() {
|
||||
if (std::abs(value) > 1
|
||||
&& (recent.size()
|
||||
< _owner->session().serverConfig().stickersRecentLimit)) {
|
||||
recent.push_back(std::make_pair(doc, std::abs(value)));
|
||||
recent.push_back({ doc, ushort(std::abs(value)) });
|
||||
}
|
||||
}
|
||||
if (def->stickers.isEmpty()) {
|
||||
@@ -2848,14 +2847,14 @@ void Account::readRecentHashtagsAndBots() {
|
||||
write.reserve(writeCount);
|
||||
for (uint32 i = 0; i < writeCount; ++i) {
|
||||
hashtags.stream >> tag >> count;
|
||||
write.push_back(std::make_pair(tag.trimmed(), count));
|
||||
write.push_back({ tag.trimmed(), count });
|
||||
}
|
||||
}
|
||||
if (searchCount) {
|
||||
search.reserve(searchCount);
|
||||
for (uint32 i = 0; i < searchCount; ++i) {
|
||||
hashtags.stream >> tag >> count;
|
||||
search.push_back(std::make_pair(tag.trimmed(), count));
|
||||
search.push_back({ tag.trimmed(), count });
|
||||
}
|
||||
}
|
||||
cSetRecentWriteHashtags(write);
|
||||
|
||||
Submodule Telegram/lib_ui updated: 73840118e2...ae492d4015
Reference in New Issue
Block a user