[Gnucash-changes] r14358 - gnucash/trunk - When committing an account during the closing of a book, don't search

David Hampton hampton at cvs.gnucash.org
Mon Jun 12 23:17:48 EDT 2006


Author: hampton
Date: 2006-06-12 23:17:48 -0400 (Mon, 12 Jun 2006)
New Revision: 14358
Trac: http://svn.gnucash.org/trac/changeset/14358

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/engine/Account.c
Log:
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.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-06-13 01:37:10 UTC (rev 14357)
+++ gnucash/trunk/ChangeLog	2006-06-13 03:17:48 UTC (rev 14358)
@@ -1,5 +1,11 @@
 2006-06-12  David Hampton  <hampton at 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
 	that it will be correctly parsed as a string.
 

Modified: gnucash/trunk/src/engine/Account.c
===================================================================
--- gnucash/trunk/src/engine/Account.c	2006-06-13 01:37:10 UTC (rev 14357)
+++ gnucash/trunk/src/engine/Account.c	2006-06-13 03:17:48 UTC (rev 14358)
@@ -381,8 +381,10 @@
        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)



More information about the gnucash-changes mailing list