mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-20 11:48:30 -06:00
Reserve space for the accounts in their vector.
Instead of creating an empty vector and then adding the accounts to the end of it.
This commit is contained in:
parent
42b4755aea
commit
bbe8ebbc15
@ -1653,7 +1653,8 @@ public:
|
||||
{
|
||||
auto widget{GNC_TREE_VIEW_ACCOUNT(get_widget())};
|
||||
auto acc_list = gnc_tree_view_account_get_selected_accounts(widget);
|
||||
GncOptionAccountList acc_vec(g_list_length(acc_list));
|
||||
GncOptionAccountList acc_vec;
|
||||
acc_vec.reserve(g_list_length(acc_list));
|
||||
for (auto node = acc_list; node; node = g_list_next(node))
|
||||
acc_vec.push_back(static_cast<const Account*>(node->data));
|
||||
g_list_free(acc_list);
|
||||
|
Loading…
Reference in New Issue
Block a user