mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-12-02 05:29:20 -06:00
[balsheet-pnl] faster definition of balance lists
because the accounts and accounts-cols-data have direct 1-to-1 mapping, it is not necessary to map accounts and retrieve from accounts-cols-data. mapping from accounts-cols-data produces identical results, avoiding O(N^2) access from accounts-cols-data.
This commit is contained in:
parent
736d223198
commit
1420368b5b
@ -753,17 +753,17 @@ also show overall period profit & loss."))
|
||||
;; account-balances is a list of monetary amounts
|
||||
(accounts-balances
|
||||
(map
|
||||
(lambda (acc)
|
||||
(cons acc (let ((cols-data (assoc-ref accounts-cols-data acc)))
|
||||
(map col-datum-get-split-balance cols-data))))
|
||||
accounts))
|
||||
(match-lambda
|
||||
((acc . cols-data)
|
||||
(cons acc (map col-datum-get-split-balance cols-data))))
|
||||
accounts-cols-data))
|
||||
|
||||
(accounts-balances-with-closing
|
||||
(map
|
||||
(lambda (acc)
|
||||
(cons acc (let ((cols-data (assoc-ref accounts-cols-data acc)))
|
||||
(map col-datum-get-split-balance-with-closing cols-data))))
|
||||
accounts))
|
||||
(match-lambda
|
||||
((acc . cols-data)
|
||||
(cons acc (map col-datum-get-split-balance-with-closing cols-data))))
|
||||
accounts-cols-data))
|
||||
|
||||
(exchange-fn (and common-currency
|
||||
(gnc:case-exchange-time-fn
|
||||
@ -914,11 +914,10 @@ also show overall period profit & loss."))
|
||||
;; split is the last one at date boundary
|
||||
(accounts-splits-dates
|
||||
(map
|
||||
(lambda (acc)
|
||||
(cons acc (let ((cols-data (assoc-ref accounts-cols-data acc)))
|
||||
(list->vector
|
||||
(map col-datum-get-last-split cols-data)))))
|
||||
accounts))
|
||||
(match-lambda
|
||||
((acc . cols-data)
|
||||
(cons acc (list->vector (map col-datum-get-last-split cols-data)))))
|
||||
accounts-cols-data))
|
||||
|
||||
(get-cell-anchor-fn
|
||||
(lambda (account col-idx)
|
||||
@ -944,10 +943,10 @@ also show overall period profit & loss."))
|
||||
;; dates. split-value-balance determined by transaction currency.
|
||||
(accounts-value-balances
|
||||
(map
|
||||
(lambda (acc)
|
||||
(cons acc (let ((cols-data (assoc-ref accounts-cols-data acc)))
|
||||
(map col-datum-get-split-value-balance cols-data))))
|
||||
accounts))
|
||||
(match-lambda
|
||||
((acc . cols-data)
|
||||
(cons acc (map col-datum-get-split-value-balance cols-data))))
|
||||
accounts-cols-data))
|
||||
|
||||
;; a vector of collectors whereby each collector is the sum
|
||||
;; of asset and liability split-value-balances at report
|
||||
|
Loading…
Reference in New Issue
Block a user