mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-25 10:20:18 -06:00
Improve performance of qof_query_invert().
Prepend terms and reverse once at the end instead of "reverse, prepend, reverse" for each term. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17001 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
2820972c30
commit
2cbd6ccdd6
@ -1022,14 +1022,9 @@ QofQuery * qof_query_invert (QofQuery *q)
|
||||
qt = copy_query_term(cur->data);
|
||||
qt->invert = !(qt->invert);
|
||||
new_oterm = g_list_append(NULL, qt);
|
||||
|
||||
/* g_list_append() can take forever, so let's do this for speed
|
||||
* in "large" queries.
|
||||
*/
|
||||
retval->terms = g_list_reverse(retval->terms);
|
||||
retval->terms = g_list_prepend(retval->terms, new_oterm);
|
||||
retval->terms = g_list_reverse(retval->terms);
|
||||
}
|
||||
retval->terms = g_list_reverse(retval->terms);
|
||||
break;
|
||||
|
||||
/* If there are multiple OR-terms, we just recurse by
|
||||
|
Loading…
Reference in New Issue
Block a user