summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp-cstr.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2021-04-12 16:42:01 +0200
committerAndrea Corallo <akrl@sdf.org>2021-04-13 12:05:33 +0200
commit3062480309b0d3bd66370265ed1a1dc79b6edeed (patch)
tree7e9f42eabfcfae56f43703e6f08068e362439a24 /lisp/emacs-lisp/comp-cstr.el
parent8ed46b7646de7166aa8bbd3b5d29a4947316c900 (diff)
downloademacs-3062480309b0d3bd66370265ed1a1dc79b6edeed.tar.gz
* lisp/emacs-lisp/comp-cstr.el (comp-normalize-valset): Remove duplicates.
Diffstat (limited to 'lisp/emacs-lisp/comp-cstr.el')
-rw-r--r--lisp/emacs-lisp/comp-cstr.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
index 7f5d34b45c3..b2d34af66b4 100644
--- a/lisp/emacs-lisp/comp-cstr.el
+++ b/lisp/emacs-lisp/comp-cstr.el
@@ -186,12 +186,14 @@ Return them as multiple value."
;;; Value handling.
(defun comp-normalize-valset (valset)
- "Sort VALSET and return it."
- (cl-sort valset (lambda (x y)
- ;; We might want to use `sxhash-eql' for speed but
- ;; this is safer to keep tests stable.
- (< (sxhash-equal x)
- (sxhash-equal y)))))
+ "Sort and remove duplicates from VALSET then return it."
+ (cl-remove-duplicates
+ (cl-sort valset (lambda (x y)
+ ;; We might want to use `sxhash-eql' for speed but
+ ;; this is safer to keep tests stable.
+ (< (sxhash-equal x)
+ (sxhash-equal y))))
+ :test #'eq))
(defun comp-union-valsets (&rest valsets)
"Union values present into VALSETS."