From 35942b81d12cb587d10a8cbf82d20e2b93bc48f7 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 5 Mar 2020 23:12:14 -0800 Subject: tags: implement merge with merge function. * tags.tl (write-tagfile): Since we can assume that the tags file is sorted, and the tags coming into this function are likewise sorted, we can just merge the sorted lists. Then, we don't have to sort the tags list a second time. --- tags.tl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tags.tl b/tags.tl index bb32ee44..3d6be813 100755 --- a/tags.tl +++ b/tags.tl @@ -135,10 +135,10 @@ (orig-tags (collect-each ((line lines)) (new orig-tag ident (m^ #/[^\t]*/ line) line line)))) - (set tags (append tags orig-tags))) + (set tags (merge tags orig-tags : .ident))) (path-not-found (e)))) (with-stream (stream (open-file "tags" (if o.append "a" "w"))) - (each ((tag (sort tags : .ident))) + (each ((tag tags)) (put-line tag.(text) stream)))) (let ((o (new tags-opts))) -- cgit v1.2.3