mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 798810 - Income Statement (multicolumn) - account sorting is...
'reversed' each time you restart. Lists read from the front, vectors to the back, so reverse the vector after loading it. While we're at it reserve enough elements to hold the list.
This commit is contained in:
parent
a2098b383c
commit
634b9f8744
@ -466,6 +466,9 @@ scm_to_value<GncOptionAccountList>(SCM new_value)
|
||||
GncOptionAccountList retval{};
|
||||
if (scm_is_false(scm_list_p(new_value)) || scm_is_null(new_value))
|
||||
return retval;
|
||||
|
||||
retval.reserve(scm_to_size_t(scm_length(new_value)));
|
||||
|
||||
auto next{new_value};
|
||||
while (!scm_is_null(next) && scm_car(next))
|
||||
{
|
||||
@ -491,6 +494,8 @@ scm_to_value<GncOptionAccountList>(SCM new_value)
|
||||
}
|
||||
next = scm_cdr(next);
|
||||
}
|
||||
|
||||
std::reverse(retval.begin(), retval.end());
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user