Use td::append if possible.
This commit is contained in:
parent
8096cf0439
commit
e3256e7b4c
@ -1157,7 +1157,7 @@ void PollManager::on_get_poll_voters(PollId poll_id, int32 option_id, string off
|
|||||||
LOG(ERROR) << "Receive " << user_id << " as voter in " << poll_id;
|
LOG(ERROR) << "Receive " << user_id << " as voter in " << poll_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
voters.voter_user_ids_.insert(voters.voter_user_ids_.end(), user_ids.begin(), user_ids.end());
|
append(voters.voter_user_ids_, user_ids);
|
||||||
if (static_cast<int32>(user_ids.size()) > limit) {
|
if (static_cast<int32>(user_ids.size()) > limit) {
|
||||||
user_ids.resize(limit);
|
user_ids.resize(limit);
|
||||||
}
|
}
|
||||||
|
@ -1777,7 +1777,7 @@ Status FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sync) {
|
|||||||
|
|
||||||
bool send_updates_flag = false;
|
bool send_updates_flag = false;
|
||||||
auto other_pmc_id = other_node->pmc_id_;
|
auto other_pmc_id = other_node->pmc_id_;
|
||||||
node->file_ids_.insert(node->file_ids_.end(), other_node->file_ids_.begin(), other_node->file_ids_.end());
|
append(node->file_ids_, other_node->file_ids_);
|
||||||
|
|
||||||
for (auto file_id : other_node->file_ids_) {
|
for (auto file_id : other_node->file_ids_) {
|
||||||
auto file_id_info = get_file_id_info(file_id);
|
auto file_id_info = get_file_id_info(file_id);
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "td/actor/impl/Event.h"
|
#include "td/actor/impl/Event.h"
|
||||||
#include "td/actor/impl/EventFull.h"
|
#include "td/actor/impl/EventFull.h"
|
||||||
|
|
||||||
|
#include "td/utils/algorithm.h"
|
||||||
#include "td/utils/common.h"
|
#include "td/utils/common.h"
|
||||||
#include "td/utils/ExitGuard.h"
|
#include "td/utils/ExitGuard.h"
|
||||||
#include "td/utils/format.h"
|
#include "td/utils/format.h"
|
||||||
@ -26,7 +27,6 @@
|
|||||||
#include "td/utils/Time.h"
|
#include "td/utils/Time.h"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iterator>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@ -314,8 +314,7 @@ void Scheduler::register_migrated_actor(ActorInfo *actor_info) {
|
|||||||
}
|
}
|
||||||
auto it = pending_events_.find(actor_info);
|
auto it = pending_events_.find(actor_info);
|
||||||
if (it != pending_events_.end()) {
|
if (it != pending_events_.end()) {
|
||||||
actor_info->mailbox_.insert(actor_info->mailbox_.end(), std::make_move_iterator(it->second.begin()),
|
append(actor_info->mailbox_, std::move(it->second));
|
||||||
std::make_move_iterator(it->second.end()));
|
|
||||||
pending_events_.erase(it);
|
pending_events_.erase(it);
|
||||||
}
|
}
|
||||||
if (actor_info->mailbox_.empty()) {
|
if (actor_info->mailbox_.empty()) {
|
||||||
|
@ -115,7 +115,7 @@ void Hints::add_search_results(vector<KeyT> &results, const string &word,
|
|||||||
LOG(DEBUG) << "Search for word " << word;
|
LOG(DEBUG) << "Search for word " << word;
|
||||||
auto it = word_to_keys.lower_bound(word);
|
auto it = word_to_keys.lower_bound(word);
|
||||||
while (it != word_to_keys.end() && begins_with(it->first, word)) {
|
while (it != word_to_keys.end() && begins_with(it->first, word)) {
|
||||||
results.insert(results.end(), it->second.begin(), it->second.end());
|
append(results, it->second);
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user