diff --git a/bindings/engine.i b/bindings/engine.i index bdc4d1abac..5b1d5b587c 100644 --- a/bindings/engine.i +++ b/bindings/engine.i @@ -168,7 +168,7 @@ SplitsVec gnc_get_match_commodity_splits (AccountVec accounts, bool use_end_date { gnc_account_foreach_split_until_date (acc, end_date, maybe_accumulate); }; else scan_account = [maybe_accumulate](auto acc) - { gnc_account_foreach_split (acc, maybe_accumulate, false); }; + { gnc_account_foreach_split (acc, maybe_accumulate); }; std::for_each (accounts.begin(), accounts.end(), scan_account); if (sort) diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp index 3ad3ee5150..6e6f6ae2ba 100644 --- a/libgnucash/engine/Account.cpp +++ b/libgnucash/engine/Account.cpp @@ -1137,17 +1137,13 @@ xaccInitAccount (Account * acc, QofBook *book) \********************************************************************/ void -gnc_account_foreach_split (const Account *acc, std::function func, - bool reverse) +gnc_account_foreach_split (const Account *acc, std::function func) { if (!GNC_IS_ACCOUNT (acc)) return; auto& splits{GET_PRIVATE(acc)->splits}; - if (reverse) - std::for_each(splits.rbegin(), splits.rend(), func); - else - std::for_each(splits.begin(), splits.end(), func); + std::for_each (splits.begin(), splits.end(), func); } void @@ -5012,7 +5008,7 @@ void gnc_account_tree_begin_staged_transaction_traversals (Account *account) { auto do_one_account = [](auto acc) - { gnc_account_foreach_split (acc, [](auto s){ s->parent->marker = 0; }, false); }; + { gnc_account_foreach_split (acc, [](auto s){ s->parent->marker = 0; }); }; gnc_account_foreach_descendant (account, do_one_account); } diff --git a/libgnucash/engine/Account.hpp b/libgnucash/engine/Account.hpp index 598cd0a5df..9049cb94b7 100644 --- a/libgnucash/engine/Account.hpp +++ b/libgnucash/engine/Account.hpp @@ -44,7 +44,7 @@ const SplitsVec& xaccAccountGetSplits (const Account*); void gnc_account_foreach_descendant (const Account *, std::function func); -void gnc_account_foreach_split (const Account*, std::function, bool); +void gnc_account_foreach_split (const Account*, std::function); void gnc_account_foreach_split_until_date (const Account *acc, time64 end_date, std::function f); diff --git a/libgnucash/engine/Scrub.cpp b/libgnucash/engine/Scrub.cpp index f819ef41af..73c91ca5eb 100644 --- a/libgnucash/engine/Scrub.cpp +++ b/libgnucash/engine/Scrub.cpp @@ -98,7 +98,7 @@ get_all_transactions (Account *account, bool descendants) { TransSet set; auto add_transactions = [&set](auto a) - { gnc_account_foreach_split (a, [&set](auto s){ set.insert (xaccSplitGetParent (s)); }, false); }; + { gnc_account_foreach_split (a, [&set](auto s){ set.insert (xaccSplitGetParent (s)); }); }; add_transactions (account); if (descendants) gnc_account_foreach_descendant (account, add_transactions);