aboutsummaryrefslogtreecommitdiff
path: root/module/datetime/zic.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-02-23 02:18:57 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2023-02-23 04:03:36 +0100
commit5ab726d27c2a300fefbcc843ad01a7c04590ff15 (patch)
treedb9e7bc8e047fdc5242a9b7c55883c6892770963 /module/datetime/zic.scm
parentExtend `for'-macro to allow improper list elements. (diff)
downloadcalp-5ab726d27c2a300fefbcc843ad01a7c04590ff15.tar.gz
calp-5ab726d27c2a300fefbcc843ad01a7c04590ff15.tar.xz
Change group-by to return direct pairs.
Each value in the return of group-by must have exactly two values, so cons pairs (instead of lists) is much better.
Diffstat (limited to 'module/datetime/zic.scm')
-rw-r--r--module/datetime/zic.scm8
1 files changed, 4 insertions, 4 deletions
diff --git a/module/datetime/zic.scm b/module/datetime/zic.scm
index ace3d991..470f6c07 100644
--- a/module/datetime/zic.scm
+++ b/module/datetime/zic.scm
@@ -298,16 +298,16 @@
(for-each (lambda (group)
(hashq-set! rules
(car group)
- (sort* (cadr group)
+ (sort* (cdr group)
(lambda (a b) (if (eq? 'minimum) #t (< a b)))
rule-from)))
- (group-by rule-name (car it))))
+ (group-by rule-name it)))
;; put zones in map
(awhen (assoc-ref groups 'zone)
(for-each (lambda (zone)
(hash-set! zones (zone-name zone) (zone-entries zone)))
- (car it)))
+ it))
;; resolve links to extra entries in the zone map
(awhen (assoc-ref groups 'link)
@@ -318,7 +318,7 @@
(if (not target-item)
(warning (G_ "Unresolved link, target missing ~a -> ~a") name target)
(hash-set! zones name target-item))))
- (car it)))
+ it))
(make-zoneinfo rules zones)))