Avoid copying local instance of AccountTokenCount

This commit is contained in:
Christian Gruber 2020-02-17 22:56:15 +01:00
parent d07d4b962f
commit 41863be9c7

View File

@ -5284,11 +5284,8 @@ build_token_info(char const * suffix, KvpValue * value, TokenAccountsInfo & toke
if (strlen(suffix) == GUID_ENCODING_LENGTH) if (strlen(suffix) == GUID_ENCODING_LENGTH)
{ {
tokenInfo.total_count += value->get<int64_t>(); tokenInfo.total_count += value->get<int64_t>();
AccountTokenCount this_account;
/*By convention, the key ends with the account GUID.*/ /*By convention, the key ends with the account GUID.*/
this_account.account_guid = std::string{suffix}; tokenInfo.accounts.emplace_back(AccountTokenCount{std::string{suffix}, value->get<int64_t>()});
this_account.token_count = value->get<int64_t>();
tokenInfo.accounts.push_back(this_account);
} }
} }