Skip to content

Commit

Permalink
Unify begin/end usages.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 422dd5dbfdab7240818bbc35a7c554effa097378
  • Loading branch information
levlam committed Aug 9, 2020
1 parent b1adbcb commit 983119a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions td/telegram/SecretChatActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void SecretChatActor::send_message_impl(tl_object_ptr<secret_api::DecryptedMessa
LOG(INFO) << "Send message: " << to_string(*message) << to_string(file);

auto it = random_id_to_outbound_message_state_token_.find(random_id);
if (it != end(random_id_to_outbound_message_state_token_)) {
if (it != random_id_to_outbound_message_state_token_.end()) {
return on_outbound_outer_send_message_promise(it->second, std::move(promise));
}

Expand Down Expand Up @@ -1126,8 +1126,8 @@ void SecretChatActor::do_outbound_message_impl(unique_ptr<logevent::OutboundSecr
}

void SecretChatActor::on_his_in_seq_no_updated() {
auto it = begin(out_seq_no_to_outbound_message_state_token_);
while (it != end(out_seq_no_to_outbound_message_state_token_) && it->first < seq_no_state_.his_in_seq_no) {
auto it = out_seq_no_to_outbound_message_state_token_.begin();
while (it != out_seq_no_to_outbound_message_state_token_.end() && it->first < seq_no_state_.his_in_seq_no) {
auto token = it->second;
it = out_seq_no_to_outbound_message_state_token_.erase(it);
on_outbound_ack(token);
Expand Down
4 changes: 2 additions & 2 deletions tdactor/td/actor/impl/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ void Scheduler::register_migrated_actor(ActorInfo *actor_info) {
}
auto it = pending_events_.find(actor_info);
if (it != pending_events_.end()) {
actor_info->mailbox_.insert(actor_info->mailbox_.end(), make_move_iterator(begin(it->second)),
make_move_iterator(end(it->second)));
actor_info->mailbox_.insert(actor_info->mailbox_.end(), std::make_move_iterator(it->second.begin()),
std::make_move_iterator(it->second.end()));
pending_events_.erase(it);
}
if (actor_info->mailbox_.empty()) {
Expand Down
4 changes: 2 additions & 2 deletions tdactor/td/actor/impl/Scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ void Scheduler::flush_mailbox(ActorInfo *actor_info, const RunFuncT &run_func, c
if (guard.can_run()) {
(*run_func)(actor_info);
} else {
mailbox.insert(begin(mailbox) + i, (*event_func)());
mailbox.insert(mailbox.begin() + i, (*event_func)());
}
}
mailbox.erase(begin(mailbox), begin(mailbox) + i);
mailbox.erase(mailbox.begin(), mailbox.begin() + i);
}

inline void Scheduler::send_to_scheduler(int32 sched_id, const ActorId<> &actor_id, Event &&event) {
Expand Down

0 comments on commit 983119a

Please sign in to comment.