summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-05-12 16:38:34 -0700
committerBen Sima <ben@bsima.me>2020-05-12 16:38:34 -0700
commit500017f2aa6ec1b4679a6878a7624eb7beaf1ee2 (patch)
treedb464534eb2a2962fc4868784dfeca382ac13ccf
parent0bbb74b7b0d8130cfcb71aedd7971e2906362a08 (diff)
Idempotently add id to tag index
-rw-r--r--z.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/z.scm b/z.scm
index 46e6fcf..6cec0dd 100644
--- a/z.scm
+++ b/z.scm
@@ -161,7 +161,10 @@
(dict.update
*tags*
tag
- (/. ids (cons id ids))))))))
+ (/. ids
+ (if (contains? ids id)
+ ids
+ (cons id ids)))))))))
(define (reindex)
(set! *titles* (dict.empty))