From: Andrew G Cohen Date: Mon, 28 Oct 2019 01:37:15 +0000 (+0800) Subject: Improve compression of nnselect-artlist X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e195dc8094284bcc0765139d79e78fbb4d25faaa;p=emacs.git Improve compression of nnselect-artlist * lisp/gnus/nnselect.el (nnselect-uncompress-artlist, nnselect-get-artlist): Make the compression a bit faster and put the vectorp test into the nnselect-uncompress-artlist uncompress function. --- diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 5dbc9b21180..4a2775f3620 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -92,11 +92,17 @@ selection)) (defun nnselect-uncompress-artlist (artlist) - (let (selection) - (pcase-dolist (`(,artgroup (,artrsv . ,artseq)) artlist) - (dolist (art (reverse (gnus-uncompress-sequence artseq))) - (push (vector artgroup art artrsv) selection))) - (apply #'vector selection))) + (if (vectorp artlist) + artlist + (let (selection) + (pcase-dolist (`(,artgroup (,artrsv . ,artseq)) artlist) + (setq selection + (vconcat + (map 'vector + #'(lambda (art) + (vector artgroup art artrsv)) + (gnus-uncompress-sequence artseq)) selection))) + selection))) (defun nnselect-group-server (group) (gnus-group-server group)) @@ -211,9 +217,7 @@ as `(keyfunc member)' and the corresponding element is just `(when (gnus-nnselect-group-p ,group) (let ((artlist (gnus-group-get-parameter ,group 'nnselect-artlist t))) - (if (or (not artlist) (vectorp artlist)) - artlist - (nnselect-uncompress-artlist artlist))))) + (nnselect-uncompress-artlist artlist)))) ;;; User Customizable Variables: