diff --git a/td/telegram/PasswordManager.cpp b/td/telegram/PasswordManager.cpp index 80c1add1840d..7572254f530e 100644 --- a/td/telegram/PasswordManager.cpp +++ b/td/telegram/PasswordManager.cpp @@ -94,15 +94,14 @@ void PasswordManager::do_get_secure_secret(bool recursive, string password, opti return promise.set_error(Status::Error(400, "Failed to get secure secret")); } - auto new_promise = - PromiseCreator::lambda([recursive, password, hash = std::move(hash), promise = std::move(promise), - actor_id = actor_id](Result r_ok) mutable { - if (r_ok.is_error()) { - return promise.set_error(r_ok.move_as_error()); - } - send_closure(actor_id, &PasswordManager::do_get_secure_secret, false, std::move(password), - std::move(hash), std::move(promise)); - }); + auto new_promise = PromiseCreator::lambda([password, hash = std::move(hash), promise = std::move(promise), + actor_id = actor_id](Result r_ok) mutable { + if (r_ok.is_error()) { + return promise.set_error(r_ok.move_as_error()); + } + send_closure(actor_id, &PasswordManager::do_get_secure_secret, false, std::move(password), std::move(hash), + std::move(promise)); + }); UpdateSettings update_settings; update_settings.current_password = password; diff --git a/tdactor/test/actors_impl2.cpp b/tdactor/test/actors_impl2.cpp index 9185fe8858d3..a5623181201d 100644 --- a/tdactor/test/actors_impl2.cpp +++ b/tdactor/test/actors_impl2.cpp @@ -199,7 +199,6 @@ TEST(Actor2, locker_stress) { std::atomic begin{0}; std::atomic ready{0}; std::atomic check{0}; - std::atomic finish{0}; std::vector threads; for (size_t i = 0; i < threads_n; i++) { threads.push_back(td::thread([&, id = i] { diff --git a/tdutils/td/utils/crypto.cpp b/tdutils/td/utils/crypto.cpp index f99e9341835d..ce57f2dc9312 100644 --- a/tdutils/td/utils/crypto.cpp +++ b/tdutils/td/utils/crypto.cpp @@ -469,7 +469,8 @@ Result rsa_encrypt_pkcs1_oaep(Slice public_key, Slice data) { RSA *rsa = pkey->pkey.rsa; int outlen = RSA_size(rsa); BufferSlice res(outlen); - if (RSA_public_encrypt(narrow_cast(data.size()), const_cast(data.ubegin()), res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING) != outlen) { + if (RSA_public_encrypt(narrow_cast(data.size()), const_cast(data.ubegin()), + res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING) != outlen) { #else EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new(pkey, nullptr); if (!ctx) { @@ -520,7 +521,8 @@ Result rsa_decrypt_pkcs1_oaep(Slice private_key, Slice data) { RSA *rsa = pkey->pkey.rsa; size_t outlen = RSA_size(rsa); BufferSlice res(outlen); - auto inlen = RSA_private_decrypt(narrow_cast(data.size()), const_cast(data.ubegin()), res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING); + auto inlen = RSA_private_decrypt(narrow_cast(data.size()), const_cast(data.ubegin()), + res.as_slice().ubegin(), rsa, RSA_PKCS1_OAEP_PADDING); if (inlen == -1) { return Status::Error("Cannot decrypt"); } diff --git a/test/tdclient.cpp b/test/tdclient.cpp index 7cef0fcbc004..63ad3b113473 100644 --- a/test/tdclient.cpp +++ b/test/tdclient.cpp @@ -242,7 +242,7 @@ class DoAuthentication : public Task { default: CHECK(false) << "Unexpected authorization state " << to_string(authorization_state); } - send_query(std::move(function), [this](auto res) { CHECK(res->get_id() == td_api::ok::ID) << to_string(res); }); + send_query(std::move(function), [](auto res) { CHECK(res->get_id() == td_api::ok::ID) << to_string(res); }); } void on_authorization_ready() { LOG(INFO) << "GOT AUTHORIZED";