mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[TR] apply custom-sort after filtering.
As a follow on to last commit, if a large datafile is subject to a reconciled date filter, the initial QofQuery date matcher would be skipped, causing a large number of splits sent for custom sorting prior to filtering. It will always be more efficient that filtering is applied first. Therefore custom sorting should be applied after filtering.
This commit is contained in:
parent
3af9acec99
commit
ae4b0bd871
@ -1977,12 +1977,6 @@ be excluded from periodic reporting.")
|
||||
|
||||
(qof-query-destroy query)
|
||||
|
||||
(if custom-sort?
|
||||
(begin
|
||||
(set! splits (stable-sort! splits date-comparator?))
|
||||
(set! splits (stable-sort! splits secondary-comparator?))
|
||||
(set! splits (stable-sort! splits primary-comparator?))))
|
||||
|
||||
;; Combined Filter:
|
||||
;; - include/exclude using split->date according to date options
|
||||
;; - include/exclude splits to/from selected accounts
|
||||
@ -2013,6 +2007,11 @@ be excluded from periodic reporting.")
|
||||
)))
|
||||
splits))
|
||||
|
||||
(when custom-sort?
|
||||
(set! splits (stable-sort! splits date-comparator?))
|
||||
(set! splits (stable-sort! splits secondary-comparator?))
|
||||
(set! splits (stable-sort! splits primary-comparator?)))
|
||||
|
||||
(if (null? splits)
|
||||
|
||||
;; error condition: no splits found
|
||||
|
Loading…
Reference in New Issue
Block a user