From 85e56e2e9564a4f055cb1f40946b1b63c218dcaa Mon Sep 17 00:00:00 2001 From: David Hampton Date: Tue, 13 Jun 2006 03:17:48 +0000 Subject: [PATCH] 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 --- ChangeLog | 6 ++++++ src/engine/Account.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 396f1b4959..fd7441369c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-06-12 David Hampton + * 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 that it will be correctly parsed as a string. diff --git a/src/engine/Account.c b/src/engine/Account.c index 17a56bb966..ccf6c4b3dd 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -381,8 +381,10 @@ xaccAccountCommitEdit (Account *acc) g_assert(acc->splits == NULL || qof_book_shutting_down(acc->inst.book)); */ - col = qof_book_get_collection(acc->inst.book, GNC_ID_TRANS); - qof_collection_foreach(col, destroy_pending_splits_for_account, acc); + if (!qof_book_shutting_down(acc->inst.book)) { + 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 */ for (lp = acc->lots; lp; lp = lp->next)