mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-26 20:02:27 +03:00
read: only run finalise twice if there are modifiers
Previously we ran if `--auto` was set. But this adds a small performance hit if `--auto` becomes default. Now we only run twice if there are transactionModifiers AND `--auto` is set. So even if auto is specified, there will be no penalty if there are no modifiers.
This commit is contained in:
parent
6c3fb56603
commit
20f134c96b
@ -264,7 +264,7 @@ parseAndFinaliseJournal parser iopts f txt = do
|
||||
-- the options for checking assertions.
|
||||
let runFin :: Bool -> Bool -> (ParsedJournal -> Either String Journal)
|
||||
runFin reorder ignore = journalFinalise t f txt reorder ignore
|
||||
fj = if auto_ iopts
|
||||
fj = if auto_ iopts && (not . null . jtxnmodifiers) pj
|
||||
then applyTransactionModifiers <$>
|
||||
runFin True False pj >>=
|
||||
runFin False (not $ ignore_assertions_ iopts)
|
||||
@ -295,7 +295,7 @@ parseAndFinaliseJournal' parser iopts f txt = do
|
||||
-- options for checking assertions.
|
||||
let runFin :: Bool -> Bool -> (ParsedJournal -> Either String Journal)
|
||||
runFin reorder ignore = journalFinalise t f txt reorder ignore
|
||||
fj = if auto_ iopts
|
||||
fj = if auto_ iopts && (not . null . jtxnmodifiers) pj
|
||||
then applyTransactionModifiers <$>
|
||||
runFin True False pj >>=
|
||||
runFin False (not $ ignore_assertions_ iopts)
|
||||
|
Loading…
Reference in New Issue
Block a user