Function: comp--normalize-valset
comp--normalize-valset is a byte-compiled function defined in
comp-cstr.el.gz.
Signature
(comp--normalize-valset VALSET)
Documentation
Sort and remove duplicates from VALSET then return it.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/comp-cstr.el.gz
;;; Value handling.
(defun comp--normalize-valset (valset)
"Sort and remove duplicates from VALSET then return it."
;; Sort valset as much as possible (by type and by value for symbols
;; and strings) to increase cache hits. But refrain to use
;; `sxhash-equal' to be reproducible across on different builds.
(cl-loop
with vals = (cl-remove-duplicates valset :test #'eq)
with type-val = (cl-loop
for type in (cl-remove-duplicates (mapcar #'cl-type-of vals)
:test #'eq)
collect (cons type nil))
for x in vals
do (push x (cdr (assq (cl-type-of x) type-val)))
finally return (cl-loop
for (type . values) in (cl-sort type-val #'string< :key #'car)
append (if (memq type '(symbol string))
(cl-sort values #'string<)
values))))