From 597080c1610a2b1dfb3511c4619cbb0ec270e56f Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Wed, 12 Sep 2012 15:23:19 -0400 Subject: [PATCH] Refactor ALL-TAGS to use mappend. --- src/indices.lisp | 5 ++--- src/packages.lisp | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/indices.lisp b/src/indices.lisp index a2d4030..66741d2 100644 --- a/src/indices.lisp +++ b/src/indices.lisp @@ -21,9 +21,8 @@ (defun all-tags () "Retrieve a list of all tags used in posts." - (sort (reduce (lambda (x y) (union x y :test #'string=)) - (mapcar #'post-tags (hash-table-values *posts*))) - #'string<)) + (sort (remove-duplicates (mappend 'post-tags (hash-table-values *posts*)) + :test #'string=) #'string<)) (defun get-month (timestamp) "Extract the YYYY-MM portion of TIMESTAMP." diff --git a/src/packages.lisp b/src/packages.lisp index 2652d73..ffc91d8 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -2,7 +2,8 @@ (:documentation "Homepage: Github") (:use :cl) (:import-from :alexandria #:hash-table-values - #:make-keyword) + #:make-keyword + #:mappend) (:import-from :closure-template #:compile-template) (:export #:main #:add-injection