From 228d485e10f44b402843badabba4f09599f3c2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 5 May 2020 21:34:52 +0200 Subject: Change to only call get-datetime in parse. --- module/vcomponent/parse.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'module/vcomponent/parse.scm') diff --git a/module/vcomponent/parse.scm b/module/vcomponent/parse.scm index b5bb17e9..a21d6ca1 100644 --- a/module/vcomponent/parse.scm +++ b/module/vcomponent/parse.scm @@ -118,10 +118,18 @@ (let ((type (and=> (prop vline 'VALUE) car))) (if (or (and=> type (cut string=? <> "DATE-TIME")) (string-contains (value vline) "T")) - (set! (value vline) (parse-ics-datetime (value vline) tz) + ;; TODO TODO TODO + ;; we move all parsed datetimes to local time here. This + ;; gives a MASSIVE performance boost over calling get-datetime + ;; in all procedures which want to guarantee local time for proper calculations. + ;; 20s vs 70s runtime on my laptop. + ;; We sohuld however save the original datetime in a file like X-HNH-DTSTART, + ;; since we don't want to lose that information. + (set! (value vline) (get-datetime (parse-ics-datetime (value vline) tz)) (prop vline 'VALUE) 'DATE-TIME) (set! (value vline) (parse-ics-date (value vline)) - (prop vline 'VALUE) 'DATE))))])) + (prop vline 'VALUE) 'DATE))) + )])) ;; Reads a vcomponent from the given port. (define-public (parse-calendar port) -- cgit v1.2.3