(defun comp-normalize-valset (valset)
"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))
+ (cl-sort (cl-remove-duplicates valset :test #'eq)
+ (lambda (x y)
+ (cond
+ ((and (symbolp x) (symbolp y))
+ (string< x y))
+ ((and (symbolp x) (not (symbolp y)))
+ t)
+ ((and (not (symbolp x)) (symbolp y))
+ nil)
+ (t
+ (< (sxhash-equal x)
+ (sxhash-equal y)))))))
(defun comp-union-valsets (&rest valsets)
"Union values present into VALSETS."