Skip to content

Commit

Permalink
;roi: optimize "one period per report interval" case a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
adept committed Jan 19, 2025
1 parent edfcd35 commit c5d8ece
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hledger/Hledger/Cli/Commands/Roi.hs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ roi CliOpts{rawopts_=rawopts, reportspec_=rspec@ReportSpec{_rsReportOpts=ReportO
, T.pack $ printf "%0.2f%%" $ smallIsZero annualizedTwr ]

periodRows <- forM spans processSpan
totalRow <- processSpan fullPeriod
totalRow <- case periodRows of
[singleRow] -> return singleRow
_ -> processSpan fullPeriod

let rowTitles = Tab.Group Tab.NoLine (map (Header . T.pack . show) (take (length periodRows) [1..]))

Expand Down

0 comments on commit c5d8ece

Please sign in to comment.