diff options
| author | levlam <levlam@telegram.org> | 2025-05-13 16:17:58 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2025-05-13 16:17:58 +0300 |
| commit | e55e678ff4a5ec23a542460a45e0e6b1b5cc2651 (patch) | |
| tree | 9ab31244b485a5fdf813cd3419c123fcfb4d11da | |
| parent | fe2f2f1d54d44e9a59c4421bf676ee21c3445286 (diff) | |
Improve *_list variable names.
| -rw-r--r-- | td/telegram/net/Session.cpp | 6 | ||||
| -rw-r--r-- | td/telegram/net/Session.h | 2 | ||||
| -rw-r--r-- | tdactor/td/actor/impl/Scheduler-decl.h | 4 | ||||
| -rw-r--r-- | tdactor/td/actor/impl/Scheduler.cpp | 32 | ||||
| -rw-r--r-- | tdactor/td/actor/impl/Scheduler.h | 2 | ||||
| -rw-r--r-- | tdtl/td/tl/tl_config.cpp | 6 | ||||
| -rw-r--r-- | tdtl/td/tl/tl_config.h | 2 |
7 files changed, 27 insertions, 27 deletions
diff --git a/td/telegram/net/Session.cpp b/td/telegram/net/Session.cpp index 7602c70ec..b330faf3f 100644 --- a/td/telegram/net/Session.cpp +++ b/td/telegram/net/Session.cpp @@ -573,9 +573,9 @@ Status Session::on_pong(double ping_time, double pong_time, double current_time) << " after ping sent at " << ping_time << " and answered at " << pong_time << " with the current server time " << current_time); } - if (!sent_queries_list_.empty()) { + if (!sent_query_list_.empty()) { double query_timeout = 60 + (current_time - ping_time); - for (auto it = sent_queries_list_.prev; it != &sent_queries_list_; it = it->prev) { + for (auto it = sent_query_list_.prev; it != &sent_query_list_; it = it->prev) { auto query = Query::from_list_node(it); if (Timestamp::at(query->sent_at_ + query_timeout).is_in_past()) { if (status.is_ok()) { @@ -1172,7 +1172,7 @@ void Session::connection_send_query(ConnectionInfo *info, NetQueryPtr &&net_quer auto status = sent_queries_.emplace(message_id, Query{message_id, std::move(net_query), main_connection_.connection_id_, now}); LOG_CHECK(status.second) << message_id; - sent_queries_list_.put(status.first->second.get_list_node()); + sent_query_list_.put(status.first->second.get_list_node()); if (immediately_fail_query) { on_message_result_error(message_id, 401, "TEST_ERROR"); } diff --git a/td/telegram/net/Session.h b/td/telegram/net/Session.h index 9c1e9ccb2..75fe39e60 100644 --- a/td/telegram/net/Session.h +++ b/td/telegram/net/Session.h @@ -149,7 +149,7 @@ class Session final PendingQueries pending_queries_; std::map<mtproto::MessageId, Query> sent_queries_; std::deque<NetQueryPtr> pending_invoke_after_queries_; - ListNode sent_queries_list_; + ListNode sent_query_list_; struct ConnectionInfo { int8 connection_id_ = 0; diff --git a/tdactor/td/actor/impl/Scheduler-decl.h b/tdactor/td/actor/impl/Scheduler-decl.h index f05aa794c..ecdd0e48b 100644 --- a/tdactor/td/actor/impl/Scheduler-decl.h +++ b/tdactor/td/actor/impl/Scheduler-decl.h @@ -228,8 +228,8 @@ class Scheduler { unique_ptr<ObjectPool<ActorInfo>> actor_info_pool_; int32 actor_count_ = 0; - ListNode pending_actors_list_; - ListNode ready_actors_list_; + ListNode pending_actors_; + ListNode ready_actors_; KHeap<double> timeout_queue_; FlatHashMap<ActorInfo *, std::vector<Event>> pending_events_; diff --git a/tdactor/td/actor/impl/Scheduler.cpp b/tdactor/td/actor/impl/Scheduler.cpp index 0fc4d3545..4fec1fd3c 100644 --- a/tdactor/td/actor/impl/Scheduler.cpp +++ b/tdactor/td/actor/impl/Scheduler.cpp @@ -167,9 +167,9 @@ EventGuard::~EventGuard() { auto node = info->get_list_node(); node->remove(); if (info->mailbox_.empty()) { - scheduler_->pending_actors_list_.put(node); + scheduler_->pending_actors_.put(node); } else { - scheduler_->ready_actors_list_.put(node); + scheduler_->ready_actors_.put(node); } info->finish_run(); swap_context(info); @@ -244,12 +244,12 @@ void Scheduler::clear() { if (!service_actor_.empty()) { service_actor_.do_stop(); } - while (!pending_actors_list_.empty()) { - auto actor_info = ActorInfo::from_list_node(pending_actors_list_.get()); + while (!pending_actors_.empty()) { + auto actor_info = ActorInfo::from_list_node(pending_actors_.get()); do_stop_actor(actor_info); } - while (!ready_actors_list_.empty()) { - auto actor_info = ActorInfo::from_list_node(ready_actors_list_.get()); + while (!ready_actors_.empty()) { + auto actor_info = ActorInfo::from_list_node(ready_actors_.get()); do_stop_actor(actor_info); } poll_.clear(); @@ -347,9 +347,9 @@ void Scheduler::register_migrated_actor(ActorInfo *actor_info) { pending_events_.erase(it); } if (actor_info->mailbox_.empty()) { - pending_actors_list_.put(actor_info->get_list_node()); + pending_actors_.put(actor_info->get_list_node()); } else { - ready_actors_list_.put(actor_info->get_list_node()); + ready_actors_.put(actor_info->get_list_node()); } actor_info->get_actor_unsafe()->on_finish_migrate(); } @@ -409,7 +409,7 @@ void Scheduler::add_to_mailbox(ActorInfo *actor_info, Event &&event) { if (!actor_info->is_running()) { auto node = actor_info->get_list_node(); node->remove(); - ready_actors_list_.put(node); + ready_actors_.put(node); } VLOG(actor) << "Add to mailbox: " << *actor_info << " " << event; actor_info->mailbox_.push_back(std::move(event)); @@ -535,9 +535,9 @@ void Scheduler::flush_mailbox(ActorInfo *actor_info) { void Scheduler::run_mailbox() { VLOG(actor) << "Run mailbox : begin"; - ListNode actors_list = std::move(ready_actors_list_); - while (!actors_list.empty()) { - ListNode *node = actors_list.get(); + ListNode ready_actors = std::move(ready_actors_); + while (!ready_actors.empty()) { + ListNode *node = ready_actors.get(); CHECK(node); auto actor_info = ActorInfo::from_list_node(node); flush_mailbox(actor_info); @@ -547,14 +547,14 @@ void Scheduler::run_mailbox() { // Useful for debug, but O(ActorCount) check // int cnt = 0; - // for (ListNode *end = &pending_actors_list_, *it = pending_actors_list_.next; it != end; it = it->next) { + // for (ListNode *end = &pending_actors_, *it = pending_actors_.next; it != end; it = it->next) { // cnt++; // auto actor_info = ActorInfo::from_list_node(it); // LOG(ERROR) << *actor_info; // CHECK(actor_info->mailbox_.empty()); // CHECK(!actor_info->is_running()); // } - // for (ListNode *end = &ready_actors_list_, *it = ready_actors_list_.next; it != end; it = it->next) { + // for (ListNode *end = &ready_actors_, *it = ready_actors_.next; it != end; it = it->next) { // auto actor_info = ActorInfo::from_list_node(it); // LOG(ERROR) << *actor_info; // cnt++; @@ -580,7 +580,7 @@ Timestamp Scheduler::run_events(Timestamp timeout) { do { run_mailbox(); res = run_timeout(); - } while (!ready_actors_list_.empty() && !timeout.is_in_past()); + } while (!ready_actors_.empty() && !timeout.is_in_past()); return res; } @@ -599,7 +599,7 @@ void Scheduler::run_no_guard(Timestamp timeout) { } Timestamp Scheduler::get_timeout() { - if (!ready_actors_list_.empty()) { + if (!ready_actors_.empty()) { return Timestamp::in(0); } if (timeout_queue_.empty()) { diff --git a/tdactor/td/actor/impl/Scheduler.h b/tdactor/td/actor/impl/Scheduler.h index 8a23ca03d..e9ae2c5f0 100644 --- a/tdactor/td/actor/impl/Scheduler.h +++ b/tdactor/td/actor/impl/Scheduler.h @@ -111,7 +111,7 @@ ActorOwn<ActorT> Scheduler::register_actor_impl(Slice name, ActorT *actor_ptr, A send_later(actor_id, Event::start()); do_migrate_actor(actor_info, sched_id); } else { - pending_actors_list_.put(weak_info->get_list_node()); + pending_actors_.put(weak_info->get_list_node()); if (ActorTraits<ActorT>::need_start_up) { send_later(actor_id, Event::start()); } diff --git a/tdtl/td/tl/tl_config.cpp b/tdtl/td/tl/tl_config.cpp index 4807ab806..327891055 100644 --- a/tdtl/td/tl/tl_config.cpp +++ b/tdtl/td/tl/tl_config.cpp @@ -147,7 +147,7 @@ tl_tree *tl_config_parser::read_array(int *var_count) { std::int32_t flags = FLAG_NOVAR; tl_tree *multiplicity = read_nat_expr(var_count); - tl_tree_array *T = new tl_tree_array(flags, multiplicity, read_args_list(var_count)); + tl_tree_array *T = new tl_tree_array(flags, multiplicity, read_args(var_count)); for (std::size_t i = 0; i < T->args.size(); i++) { if (!(T->args[i].flags & FLAG_NOVAR)) { @@ -218,7 +218,7 @@ tl_tree *tl_config_parser::read_expr(int *var_count) { } } -std::vector<arg> tl_config_parser::read_args_list(int *var_count) { +std::vector<arg> tl_config_parser::read_args(int *var_count) { const int schema_flag_opt_field = 2 << static_cast<int>(schema_version >= 3); const int schema_flag_has_vars = schema_flag_opt_field ^ 6; @@ -283,7 +283,7 @@ tl_combinator *tl_config_parser::read_combinator() { std::int32_t left_type = try_parse_int(); if (left_type == TLS_COMBINATOR_LEFT) { - combinator->args = read_args_list(&combinator->var_count); + combinator->args = read_args(&combinator->var_count); } else { if (left_type != TLS_COMBINATOR_LEFT_BUILTIN) { std::fprintf(stderr, "Wrong tls_combinator_left magic %d\n", static_cast<int>(left_type)); diff --git a/tdtl/td/tl/tl_config.h b/tdtl/td/tl/tl_config.h index 0b3e55fde..353ff1bcb 100644 --- a/tdtl/td/tl/tl_config.h +++ b/tdtl/td/tl/tl_config.h @@ -64,7 +64,7 @@ class tl_config_parser { tl_tree *read_type_expr(int *var_count); tl_tree *read_nat_expr(int *var_count); tl_tree *read_expr(int *var_count); - std::vector<arg> read_args_list(int *var_count); + std::vector<arg> read_args(int *var_count); tl_combinator *read_combinator(); tl_type *read_type(); |
