From 9cacaa72e8ece3ec59cde6b45cbd275fcb1d8c85 Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Mon, 14 Aug 2023 09:09:56 -0500 Subject: [PATCH] Build the pruned list with cons, not append. It is 10x faster against a large dataset. Insight from Christopher Lam. --- gnucash/import-export/qif-imp/qif-to-gnc.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnucash/import-export/qif-imp/qif-to-gnc.scm b/gnucash/import-export/qif-imp/qif-to-gnc.scm index 193c67ea61..dda5214d2a 100644 --- a/gnucash/import-export/qif-imp/qif-to-gnc.scm +++ b/gnucash/import-export/qif-imp/qif-to-gnc.scm @@ -499,10 +499,11 @@ (G_ (format #f "Warning: cannot find commodity for symbol ~a." current-symbol)))))) (if (not (equal? commodity #f)) (if (not (duplicate-price? pricedb commodity default-currency price)) - (set! pruned-prices (append pruned-prices (list price))) + (set! pruned-prices (cons price pruned-prices)) (set! pruned-price-count (+ 1 pruned-price-count)))) (update-progress)) sorted-prices) + (set! pruned-prices (reverse pruned-prices)) (if progress-dialog (begin