Improve some emplace_back/push_back usage.

This commit is contained in:
levlam 2022-10-27 12:53:53 +03:00
parent 92f8093486
commit 6319862890
4 changed files with 4 additions and 4 deletions

View File

@ -138,7 +138,7 @@ static void measure(td::StringBuilder &sb, td::Slice name, td::Slice key_name, t
ht.emplace(key_generator.next(), value_generator.next());
update();
if ((i + 1) % p == 0) {
stat.emplace_back(Stat{pi, min_ratio, max_ratio});
stat.push_back(Stat{pi, min_ratio, max_ratio});
reset();
pi++;
p *= 10;

View File

@ -5907,7 +5907,7 @@ void StickersManager::get_default_emoji_statuses(bool is_recursive,
LOG(ERROR) << "Ignore wrong sticker " << sticker_id;
continue;
}
statuses.emplace_back(td_api::make_object<td_api::emojiStatus>(custom_emoji_id.get()));
statuses.push_back(td_api::make_object<td_api::emojiStatus>(custom_emoji_id.get()));
if (statuses.size() >= 8) {
break;
}

View File

@ -638,7 +638,7 @@ Status HttpReader::parse_json_parameters(MutableSlice parameters) {
if (!parser.empty()) {
return Status::Error(400, "Bad Request: extra data after string");
}
query_->container_.emplace_back(BufferSlice("content"));
query_->container_.emplace_back("content");
query_->args_.emplace_back(query_->container_.back().as_slice(), r_value.move_as_ok());
return Status::OK();
}

View File

@ -63,7 +63,7 @@ static void do_run_list_test(ListRootT &root, std::atomic<td::uint64> &id) {
if (nodes.size() >= 20) {
return;
}
nodes.emplace_back(NodeT({next_id(), false}));
nodes.push_back(NodeT({next_id(), false}));
};
auto pop_node = [&] {
if (nodes.empty()) {