From 25bcf3eebbd897f02eb9ac0e73c3d1025f4b1ff3 Mon Sep 17 00:00:00 2001 From: Michael Rees Date: Mon, 22 Jul 2024 11:06:48 -0500 Subject: [PATCH] ;Don't apply sort spec when only sorting by date If there is no sort spec given, then the postings are already sorted by date, so there's no need to apply the default sort spec again. --- hledger-lib/Hledger/Reports/PostingsReport.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Reports/PostingsReport.hs b/hledger-lib/Hledger/Reports/PostingsReport.hs index 9bb7ec000..73c31087d 100644 --- a/hledger-lib/Hledger/Reports/PostingsReport.hs +++ b/hledger-lib/Hledger/Reports/PostingsReport.hs @@ -85,7 +85,7 @@ postingsReport rspec@ReportSpec{_rsReportOpts=ropts@ReportOpts{..}} j = items summariseps = summarisePostingsByInterval whichdate mdepth showempty colspans showempty = empty_ || average_ - sortedps = sortPostings ropts sortspec_ displayps + sortedps = if sortspec_ /= defsortspec then sortPostings ropts sortspec_ displayps else displayps -- Posting report items ready for display. items =