txnTieKnot fix (~10% memory reduce) (#483)
* bin: ignore chart and dupes addons * lib: fix txnTieKnot Ensure that postings refers to their transaction rather than original one. This should allow compiler perform destructive update and/or allow garbage collecting old transaction.
This commit is contained in:
parent
d657374ac4
commit
3af81a73ca
2
bin/.gitignore
vendored
2
bin/.gitignore
vendored
@ -1,4 +1,6 @@
|
|||||||
|
hledger-chart
|
||||||
hledger-check-dates
|
hledger-check-dates
|
||||||
|
hledger-dupes
|
||||||
hledger-equity
|
hledger-equity
|
||||||
hledger-print-unique
|
hledger-print-unique
|
||||||
hledger-register-match
|
hledger-register-match
|
||||||
|
|||||||
@ -489,7 +489,8 @@ transactionDate2 t = fromMaybe (tdate t) $ tdate2 t
|
|||||||
-- | Ensure a transaction's postings refer back to it, so that eg
|
-- | Ensure a transaction's postings refer back to it, so that eg
|
||||||
-- relatedPostings works right.
|
-- relatedPostings works right.
|
||||||
txnTieKnot :: Transaction -> Transaction
|
txnTieKnot :: Transaction -> Transaction
|
||||||
txnTieKnot t@Transaction{tpostings=ps} = t{tpostings=map (postingSetTransaction t) ps}
|
txnTieKnot t@Transaction{tpostings=ps} = t' where
|
||||||
|
t' = t{tpostings=map (postingSetTransaction t') ps}
|
||||||
|
|
||||||
-- | Ensure a transaction's postings do not refer back to it, so that eg
|
-- | Ensure a transaction's postings do not refer back to it, so that eg
|
||||||
-- recursiveSize and GHCI's :sprint work right.
|
-- recursiveSize and GHCI's :sprint work right.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user