When committing an account during the closing of a book, don't search

the engine for splits that are in the process of being assigned to the
account but aren't yet linked into the account.  This eliminates an
O(n*m) operation that will never find any work to perform.  Fixes
#344473.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14358 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2006-06-13 03:17:48 +00:00
parent 9b7245002d
commit 85e56e2e95
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,11 @@
2006-06-12 David Hampton <hampton@employees.org> 2006-06-12 David Hampton <hampton@employees.org>
* src/engine/Account.c: When committing an account during the
closing of a book, don't search the engine for splits that are in
the process of being assigned to the account but aren't yet linked
into the account. This eliminates an O(n*m) operation that will
never find any work to perform. Fixes #344473.
* src/quotes/gnc-fq-check.in: Quote the F::Q version number so * src/quotes/gnc-fq-check.in: Quote the F::Q version number so
that it will be correctly parsed as a string. that it will be correctly parsed as a string.

View File

@ -381,8 +381,10 @@ xaccAccountCommitEdit (Account *acc)
g_assert(acc->splits == NULL || qof_book_shutting_down(acc->inst.book)); g_assert(acc->splits == NULL || qof_book_shutting_down(acc->inst.book));
*/ */
col = qof_book_get_collection(acc->inst.book, GNC_ID_TRANS); if (!qof_book_shutting_down(acc->inst.book)) {
qof_collection_foreach(col, destroy_pending_splits_for_account, acc); col = qof_book_get_collection(acc->inst.book, GNC_ID_TRANS);
qof_collection_foreach(col, destroy_pending_splits_for_account, acc);
}
/* the lots should be empty by now */ /* the lots should be empty by now */
for (lp = acc->lots; lp; lp = lp->next) for (lp = acc->lots; lp; lp = lp->next)