Improve some emplace_back/push_back usage.
This commit is contained in:
parent
92f8093486
commit
6319862890
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user