From 0044ce9bd3ab56817cdddbb69dd022968afb5a5f Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 13 Nov 2019 20:10:22 +0300 Subject: [PATCH] Minor refactoring. GitOrigin-RevId: 7c02341c8382c976da485fb7e28de6dd75cd3d1c --- td/mtproto/SessionConnection.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/td/mtproto/SessionConnection.cpp b/td/mtproto/SessionConnection.cpp index 139fa3558..6e3f7fd78 100644 --- a/td/mtproto/SessionConnection.cpp +++ b/td/mtproto/SessionConnection.cpp @@ -808,8 +808,9 @@ std::pair SessionConnection::encrypted_bind(int64 perm_key, info.salt = Random::secure_int64(); info.session_id = Random::secure_int64(); - auto packet = BufferWriter{Transport::write(query_storer, auth_data_->get_main_auth_key(), &info), 0, 0}; - Transport::write(query_storer, auth_data_->get_main_auth_key(), &info, packet.as_slice()); + const AuthKey &main_auth_key = auth_data_->get_main_auth_key(); + auto packet = BufferWriter{Transport::write(query_storer, main_auth_key, &info), 0, 0}; + Transport::write(query_storer, main_auth_key, &info, packet.as_slice()); return std::make_pair(query.message_id, packet.as_buffer_slice()); }