From 13b9bb6790c103eff5b9d629808543a2d54c0706 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Fri, 5 Mar 2021 11:02:35 -0600 Subject: [PATCH] refactor function to store into account after data is finished (#15710) --- runtime/src/accounts.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index 7b3fe17e6..602ee29b4 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -163,14 +163,13 @@ impl Accounts { } fn construct_instructions_account(message: &Message) -> Account { - let mut account = Account { - data: message.serialize_instructions(), - ..Account::default() - }; - + let mut data = message.serialize_instructions(); // add room for current instruction index. - account.data.resize(account.data.len() + 2, 0); - account + data.resize(data.len() + 2, 0); + Account { + data, + ..Account::default() + } } fn load_transaction(