From c20e1612d829a52be2f400a233afe69be0f20649 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 11 Sep 2018 13:37:44 +0300 Subject: [PATCH] Remove thread 4 from tg_cli. GitOrigin-RevId: eca37443e076ab504e6be0f8852ae91049cf0bb3 --- td/telegram/cli.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 91c26e12..8e5c7a5d 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -221,7 +221,8 @@ StringBuilder &operator<<(StringBuilder &sb, const SendMessageInfo &info) { class CliClient final : public Actor { public: - CliClient(ConcurrentScheduler *scheduler, bool use_test_dc, bool get_chat_list, bool disable_network, int32 api_id, string api_hash) + CliClient(ConcurrentScheduler *scheduler, bool use_test_dc, bool get_chat_list, bool disable_network, int32 api_id, + string api_hash) : scheduler_(scheduler) , use_test_dc_(use_test_dc) , get_chat_list_(get_chat_list) @@ -3442,7 +3443,7 @@ class CliClient final : public Actor { int32 my_id_ = 0; - ConcurrentScheduler *scheduler_{ nullptr }; + ConcurrentScheduler *scheduler_{nullptr}; bool use_test_dc_ = false; ActorOwn td_; @@ -3512,7 +3513,7 @@ void main(int argc, char **argv) { if (x) { return x; } - return ""; + return std::string(); }(std::getenv("TD_API_HASH")); // TODO port OptionsParser to Windows for (int i = 1; i < argc; i++) { @@ -3558,7 +3559,7 @@ void main(int argc, char **argv) { } } - if (api_id == 0 || api_hash == "") { + if (api_id == 0 || api_hash.empty()) { LOG(ERROR) << "You should provide some valid api_id and api_hash"; return usage(); } @@ -3567,10 +3568,11 @@ void main(int argc, char **argv) { { ConcurrentScheduler scheduler; - scheduler.init(4); + scheduler.init(3); scheduler - .create_actor_unsafe(0, "CliClient", &scheduler, use_test_dc, get_chat_list, disable_network, api_id, api_hash) + .create_actor_unsafe(0, "CliClient", &scheduler, use_test_dc, get_chat_list, disable_network, api_id, + api_hash) .release(); scheduler.start();