Revert "[account.cpp] gnc_account_remove_split searches from the end"

This reverts commit 5aff4fb57d. Was not
tested properly...
This commit is contained in:
Christopher Lam 2024-05-21 22:57:41 +08:00
parent 5aff4fb57d
commit 038405b370

View File

@ -2002,11 +2002,8 @@ gnc_account_remove_split (Account *acc, Split *s)
if (!g_hash_table_remove (priv->splits_hash, s))
return false;
// search splits in reverse, because removing the latest split is
// more common (e.g. from UI or during book shutdown)
auto rit = std::remove(priv->splits.rbegin(), priv->splits.rend(), s);
priv->splits.erase(rit.base(), priv->splits.end());
auto it = std::remove (priv->splits.begin(), priv->splits.end(), s);
priv->splits.erase (it, priv->splits.end());
//FIXME: find better event type
qof_event_gen(&acc->inst, QOF_EVENT_MODIFY, nullptr);
// And send the account-based event, too